proto3 initial commit

This commit is contained in:
Segey Lapin
2020-04-13 12:45:25 +03:00
parent 69410badf6
commit 1084b6d5c3
1588 changed files with 368852 additions and 23 deletions

View File

@@ -0,0 +1,49 @@
[gd_resource type="ShaderMaterial" load_steps=3 format=2]
[ext_resource path="res://decals/scar-texture.png" type="Texture" id=1]
[sub_resource type="Shader" id=1]
code = "shader_type spatial;
render_mode unshaded, depth_draw_never, cull_front, depth_test_disable;
uniform sampler2D decal : hint_black;
uniform vec2 offset;
uniform vec2 scale;
uniform bool emulate_lighting;
uniform float brightness;
varying flat mat4 model_view_matrix;
void vertex(){
model_view_matrix = MODELVIEW_MATRIX;
}
void fragment(){
//float zdepth = textureLod(DEPTH_TEXTURE, SCREEN_UV, 0.0).r * 2.0 - 1.0;
vec4 pos = inverse(model_view_matrix) * INV_PROJECTION_MATRIX * vec4(SCREEN_UV * 2.0 - 1.0, textureLod(DEPTH_TEXTURE, SCREEN_UV, 0.0).r * 2.0 - 1.0, 1.0);
pos.xyz /= pos.w;
bool inside = all(greaterThanEqual(pos.xyz, vec3(-1.0))) && all(lessThanEqual(pos.xyz, vec3(1.0)));
if(inside){
vec4 color = texture(decal, (pos.xy * -0.5 - 0.5) * scale + offset);
if(emulate_lighting){
float lum = dot(textureLod(SCREEN_TEXTURE, SCREEN_UV, 0).rgb, vec3(0.2125, 0.7154, 0.0721));
lum += brightness;
lum = clamp(lum, 0.0, 1.0);
ALBEDO = color.rgb * lum;
}else{
ALBEDO = color.rgb;
}
ALPHA = color.a;
}else{
discard;
}
}"
[resource]
shader = SubResource( 1 )
shader_param/offset = Vector2( 0.5, 0.5 )
shader_param/scale = Vector2( 20, 20 )
shader_param/emulate_lighting = false
shader_param/brightness = null
shader_param/decal = ExtResource( 1 )

View File

@@ -0,0 +1,48 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://decals/decal_test1.tres" type="Material" id=1]
[sub_resource type="CubeMesh" id=1]
[sub_resource type="SpatialMaterial" id=2]
albedo_color = Color( 0.57, 0.35202, 0.2565, 1 )
[sub_resource type="CubeMesh" id=3]
size = Vector3( 0.1, 0.1, 0.01 )
[node name="decal_test" type="Spatial"]
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 20, 0 )
[node name="cube" type="MeshInstance" parent="."]
mesh = SubResource( 1 )
material/0 = SubResource( 2 )
[node name="decal" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 0.0229489, -0.999737, 0, 0.999737, 0.0229489, -0.208516, 1.00603, -0.087188 )
mesh = SubResource( 3 )
material/0 = ExtResource( 1 )
[node name="decal2" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 0.0229489, -0.999737, 0, 0.999737, 0.0229489, -0.185019, 1.00603, -0.244753 )
mesh = SubResource( 3 )
material/0 = ExtResource( 1 )
[node name="decal3" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 0.0229489, -0.999737, 0, 0.999737, 0.0229489, -0.185019, 1.00603, -0.121742 )
mesh = SubResource( 3 )
material/0 = ExtResource( 1 )
[node name="decal4" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 0.0229489, -0.999737, 0, 0.999737, 0.0229489, -0.185019, 1.00603, -0.18462 )
mesh = SubResource( 3 )
material/0 = ExtResource( 1 )
[node name="decal5" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 0.0229489, -0.999737, 0, 0.999737, 0.0229489, -0.152542, 1.00603, -0.087188 )
mesh = SubResource( 3 )
material/0 = ExtResource( 1 )
[node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 0.726059, 0.687633, 0, -0.687633, 0.726059, 0, 1.57898, 0.848999 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 KiB

View File

@@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/scar-texture.png-94278f85a0f195df31c52d9c1340d370.s3tc.stex"
path.etc2="res://.import/scar-texture.png-94278f85a0f195df31c52d9c1340d370.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://decals/scar-texture.png"
dest_files=[ "res://.import/scar-texture.png-94278f85a0f195df31c52d9c1340d370.s3tc.stex", "res://.import/scar-texture.png-94278f85a0f195df31c52d9c1340d370.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0