ile-de-test/addons/waterways/shaders/system_renders/system_height.gdshader
2023-10-05 20:02:23 +02:00

15 lines
No EOL
355 B
Text

shader_type spatial;
render_mode unshaded;
uniform float lower_bounds = 0.0;
uniform float upper_bounds = 10.0;
varying vec3 vertex_trans;
void vertex() {
vertex_trans = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
}
void fragment() {
float range = upper_bounds - lower_bounds;
ALBEDO = vec3( clamp((vertex_trans.y - lower_bounds) / range, 0.0, 1.0) );
}