9 lines
196 B
GLSL

#version 330 core
in float Height;
out vec4 FragColor;
void main() {
float h = (Height + 16)/32.0f; // shift and scale the height into a grayscale value
FragColor = vec4(h, h, h, 1.0);
}