-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSpatial.tscn
101 lines (83 loc) · 3.36 KB
/
Spatial.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
[gd_scene load_steps=12 format=2]
[ext_resource path="res://Camera.gd" type="Script" id=1]
[ext_resource path="res://Spatial.gd" type="Script" id=2]
[sub_resource type="Curve" id=1]
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.500555, 0.301887 ), 0.603104, 0.92615, 1, 1, Vector2( 0.958934, 0.726415 ), 1.30769, 2.02381, 0, 0, Vector2( 1, 1 ), 16.4999, 0.0, 0, 0 ]
[sub_resource type="OpenSimplexNoise" id=2]
[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 sampler2D gradient;
uniform float specular;
uniform float metallic;
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;
void fragment() {
vec3 world_normal = NORMAL * mat3(INV_CAMERA_MATRIX);
float slope = 1.0 - abs(world_normal.y);
slope = clamp(slope * 5.0, 0.0, 1.0);
float height = (CAMERA_MATRIX * vec4(VERTEX, 1.0)).y / 80.0;
vec4 height_color = texture(gradient, vec2(smoothstep(0.3, 0.4, height), 0.0));
vec4 slope_color = texture(gradient, vec2(slope, 0.0));
ALBEDO = mix(slope_color, height_color, smoothstep(0.4, 0.7, height)).rgb;
METALLIC = metallic;
ROUGHNESS = roughness;
SPECULAR = specular;
}
"
[sub_resource type="Gradient" id=4]
offsets = PoolRealArray( 0, 0.64 )
colors = PoolColorArray( 0.147351, 0.243164, 0.0170975, 1, 0.168945, 0.0831524, 0, 1 )
[sub_resource type="GradientTexture" id=5]
gradient = SubResource( 4 )
[sub_resource type="ShaderMaterial" id=6]
shader = SubResource( 3 )
shader_param/specular = 0.0
shader_param/metallic = 0.5
shader_param/roughness = 1.0
shader_param/point_size = 0.0
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/gradient = SubResource( 5 )
[sub_resource type="ArrayMesh" id=7]
[sub_resource type="ProceduralSky" id=8]
[sub_resource type="Environment" id=9]
background_mode = 1
background_sky = SubResource( 8 )
background_color = Color( 0.87451, 0.835294, 0.678431, 1 )
ambient_light_color = Color( 1, 0.956863, 0.788235, 1 )
ambient_light_energy = 0.1
fog_color = Color( 0.87451, 0.835294, 0.678431, 1 )
fog_sun_color = Color( 0.952941, 0.937255, 0.0392157, 1 )
fog_depth_end = 709.3
ss_reflections_enabled = true
ss_reflections_fade_in = 0.113679
adjustment_enabled = true
[node name="Spatial" type="Spatial"]
script = ExtResource( 2 )
terrain_size = Vector3( 512, 256, 512 )
height_distrobution = SubResource( 1 )
noise = SubResource( 2 )
gravity = 10.0
droplet_sendiment_capacity = 8.0
[node name="Terrain" type="MeshInstance" parent="."]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 )
material_override = SubResource( 6 )
mesh = SubResource( 7 )
[node name="Camera" type="Camera" parent="."]
transform = Transform( 0.19938, 0.501222, -0.842036, 0.0128807, 0.857873, 0.5137, 0.979838, -0.113267, 0.164586, -41.822, 65.0023, 190.678 )
fov = 75.0
size = 256.0
far = 1000.0
script = ExtResource( 1 )
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 0, 0 )
directional_shadow_mode = 0
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( 9 )