waterpole improvements

This commit is contained in:
Haze Weathers 2025-02-26 04:01:29 -05:00
parent 9549acde6e
commit aa6b9cb4aa
6 changed files with 40 additions and 16 deletions

View file

@ -0,0 +1,19 @@
shader_type spatial;
render_mode specular_disabled, vertex_lighting;
uniform vec3 color_a : source_color = vec3(1.0);
uniform vec3 color_b : source_color = vec3(0.0);
uniform float stripe_count = 2.0;
uniform float twist_factor = 1.0;
uniform float speed = 0.5;
void vertex() {
float world_height = (MODEL_MATRIX * vec4(VERTEX, 1.0)).y;
UV.y = world_height - TIME * speed;
}
void fragment() {
float twisted_x = UV.x - (UV.y * twist_factor);
float stripe = step(sin(twisted_x * stripe_count * TAU), 0.0);
ALBEDO = mix(color_a, color_b, stripe);
}