'How to vary the color according to the elevation?
I would like to achieve something like this :
However, I fail to get the Y coordinates (before projection) of a given point inside the Fragment Shader.
Here is my Fragment Shader :
precision mediump float;
vec4 blue = vec4(0.0, 0.0, 1.0, 1.0);
vec4 pink = vec4(1.0, 0.0, 1.0, 1.0);
void main() {
float y_coordinates = ???
gl_FragColor = mix(blue , pink , y_coordinates);
}
Should I send them from the Vertex Shader?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

