-
Notifications
You must be signed in to change notification settings - Fork 0
/
WoodFloor.tscn
132 lines (111 loc) · 3.76 KB
/
WoodFloor.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
[gd_scene load_steps=7 format=2]
[ext_resource path="res://Floor.gd" type="Script" id=1]
[ext_resource path="res://assets/brick_floor.obj" type="ArrayMesh" id=2]
[ext_resource path="res://assets/uv_map_wood.png" type="Texture" id=3]
[sub_resource type="Shader" id=3]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float specular;
uniform float metallic;
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform sampler2D texture_metallic : hint_white;
uniform vec4 metallic_texture_channel;
uniform sampler2D texture_roughness : hint_white;
uniform vec4 roughness_texture_channel;
uniform sampler2D texture_emission : hint_black_albedo;
uniform vec4 emission : hint_color;
uniform float emission_energy;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;
uniform bool is_emissive = false;
void vertex() {
UV=UV*uv1_scale.xy+uv1_offset.xy;
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
ALBEDO = albedo.rgb * albedo_tex.rgb;
float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
METALLIC = metallic_tex * metallic;
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
ROUGHNESS = roughness_tex * roughness;
SPECULAR = specular;
vec3 emission_tex = texture(texture_emission,base_uv).rgb;
if(is_emissive) {
EMISSION = (emission.rgb+emission_tex)*emission_energy;
}
}
"
[sub_resource type="ShaderMaterial" id=4]
render_priority = 0
shader = SubResource( 3 )
shader_param/albedo = Color( 1, 1, 1, 1 )
shader_param/specular = 0.5
shader_param/metallic = 0.0
shader_param/roughness = 1.0
shader_param/point_size = 1.0
shader_param/metallic_texture_channel = Plane( 1, 0, 0, 0 )
shader_param/roughness_texture_channel = Plane( 1, 0, 0, 0 )
shader_param/emission = Color( 0.902678, 0.929688, 0.0653687, 1 )
shader_param/emission_energy = 0.25
shader_param/uv1_scale = Vector3( 1, 1, 1 )
shader_param/uv1_offset = Vector3( 0, 0, 0 )
shader_param/uv2_scale = Vector3( 1, 1, 1 )
shader_param/uv2_offset = Vector3( 0, 0, 0 )
shader_param/is_emissive = null
shader_param/texture_albedo = ExtResource( 3 )
_sections_unfolded = [ "shader_param" ]
[sub_resource type="BoxShape" id=2]
extents = Vector3( 4.00806, 0.9863, 4.00608 )
[node name="WoodFloor" type="RigidBody"]
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 11
collision_mask = 1
mode = 0
mass = 1.0
friction = 1.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = false
contacts_reported = 0
contact_monitor = false
sleeping = false
can_sleep = false
axis_lock_linear_x = false
axis_lock_linear_y = false
axis_lock_linear_z = false
axis_lock_angular_x = false
axis_lock_angular_y = false
axis_lock_angular_z = false
linear_velocity = Vector3( 0, 0, 0 )
linear_damp = -1.0
angular_velocity = Vector3( 0, 0, 0 )
angular_damp = -1.0
script = ExtResource( 1 )
_sections_unfolded = [ "Collision", "Transform" ]
[node name="MeshInstance" type="MeshInstance" parent="." index="0"]
transform = Transform( 0.751459, 0, 0, 0, 1, 0, 0, 0, 0.751459, 0, 0, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 2 )
skeleton = NodePath("..")
material/0 = SubResource( 4 )
_sections_unfolded = [ "material" ]
[node name="CollisionShape" type="CollisionShape" parent="." index="1"]
transform = Transform( 0.714623, 0, 0, 0, 1, 0, 0, 0, 0.758726, 0, 1, 0 )
shape = SubResource( 2 )
disabled = false