Added water movement
This commit is contained in:
parent
ea7e813546
commit
c3812dd54e
@ -1,6 +1,7 @@
|
||||
shader_type spatial;
|
||||
render_mode cull_disabled;
|
||||
render_mode specular_toon;
|
||||
// render_mode shadows_disabled;
|
||||
// render_mode wireframe;
|
||||
|
||||
uniform vec3 color : source_color = vec3(0.055, 0.286, 0.62);
|
||||
@ -11,6 +12,8 @@ uniform sampler2D height_map;
|
||||
uniform sampler2D normal_map;
|
||||
uniform float height_scale = 0.0;
|
||||
uniform float noise_scale = 0.5;
|
||||
uniform vec2 wave_direction = vec2(1.0, 1.0);
|
||||
uniform float time_scale : hint_range(0.0, 1.0) = 0.1;
|
||||
|
||||
varying vec2 noise_position;
|
||||
|
||||
@ -19,7 +22,8 @@ float get_fresnel(float power, vec3 normal, vec3 view) {
|
||||
}
|
||||
|
||||
void vertex() {
|
||||
noise_position = VERTEX.xz * noise_scale + 0.5;
|
||||
vec2 wave = TIME * time_scale * wave_direction;
|
||||
noise_position = (wave + VERTEX.xz) * noise_scale + 0.5;
|
||||
float height = texture(height_map, noise_position).x - 0.5;
|
||||
VERTEX.y += height * height_scale;
|
||||
}
|
||||
|
@ -21,11 +21,13 @@ noise = SubResource("FastNoiseLite_d0hd3")
|
||||
[resource]
|
||||
render_priority = 0
|
||||
shader = ExtResource("1_uj7oj")
|
||||
shader_parameter/color = Color(0.054902, 0.286275, 0.619608, 1)
|
||||
shader_parameter/fresnel_color = Color(0.141176, 0.447059, 0.901961, 1)
|
||||
shader_parameter/color = Color(0.055, 0.286, 0.62, 1)
|
||||
shader_parameter/fresnel_color = Color(0.141, 0.447, 0.902, 1)
|
||||
shader_parameter/fresnel_reduction = 5.0
|
||||
shader_parameter/roughness = 0.02
|
||||
shader_parameter/height_scale = 0.0
|
||||
shader_parameter/noise_scale = 0.5
|
||||
shader_parameter/wave_direction = Vector2(1, 1)
|
||||
shader_parameter/time_scale = 0.1
|
||||
shader_parameter/height_map = SubResource("NoiseTexture2D_7t3c8")
|
||||
shader_parameter/normal_map = SubResource("NoiseTexture2D_rcc52")
|
||||
|
Loading…
Reference in New Issue
Block a user