ile-de-test/addons/waterways/shaders/system_renders/system_height.gdshader

15 lines
355 B
Text
Raw Normal View History

2023-10-05 18:02:23 +00:00
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) );
}