// Flat sandy floor with slowly drifting caustic lines. The pattern is purely // presentational and time-driven by the shader clock; no gameplay reads it. shader_type spatial; uniform vec3 sand_color : source_color = vec3(0.34, 0.32, 0.25); uniform vec3 caustic_tint : source_color = vec3(0.55, 0.82, 0.92); uniform sampler2D caustic_noise : repeat_enable, filter_linear_mipmap; uniform float caustic_scale = 0.055; uniform float caustic_speed = 0.018; uniform float caustic_strength : hint_range(0.0, 2.0) = 0.25; varying vec2 world_xz; void vertex() { world_xz = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xz; } void fragment() { vec2 drift_a = TIME * caustic_speed * vec2(1.0, 0.6); vec2 drift_b = TIME * caustic_speed * vec2(-0.7, 1.0); float layer_a = texture(caustic_noise, world_xz * caustic_scale + drift_a).r; float layer_b = texture(caustic_noise, world_xz * caustic_scale * 1.35 + drift_b).r; float caustic = pow(clamp(min(layer_a, layer_b) * 1.9, 0.0, 1.0), 4.0); ALBEDO = sand_color; ROUGHNESS = 0.95; METALLIC = 0.0; EMISSION = caustic_tint * caustic * caustic_strength; }