turnoff ripples when is not rainy

This commit is contained in:
2026-04-22 00:03:01 +02:00
parent f3120c6972
commit 174ae98242
4 changed files with 6 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
shader_type spatial;
render_mode blend_mix, depth_draw_always;
global uniform float global_rain_intensity;
//Water color
uniform vec4 deep_water_color : source_color = vec4(0.0, 0.1, 0.2, 1.0);
uniform vec4 shallow_water_color : source_color = vec4(0.0, 0.4, 0.7, 1.0);
@@ -41,6 +43,7 @@ void fragment() {
float water_depth_gradient = exp(-depth_difference * beer_law_factor);
vec4 base_water = mix(deep_water_color, shallow_water_color, water_depth_gradient);
float rain_intensity = clamp(global_rain_intensity, 0.0, 1.0);
vec2 pos = world_pos_xz * ripple_scale;
vec2 cell = floor(pos);
@@ -56,6 +59,7 @@ void fragment() {
- smoothstep(local_time, local_time + ripple_thickness, dist);
ring *= (1.0 - local_time);
}
ring *= rain_intensity;
vec2 ref_uv = SCREEN_UV;
@@ -85,4 +89,4 @@ void fragment() {
ROUGHNESS = 1.0;
SPECULAR = 0.0;
}
}