Auto radar
[tar-legacy.git] / MCDV / shaders / depth.fs
1 #version 330 core
2 out vec4 FragColor;
3
4 uniform vec3 color;
5 uniform float test;
6
7 uniform float HEIGHT_MIN;
8 uniform float HEIGHT_MAX;
9
10 in vec3 FragPos;
11 in float Depth;
12 in float Alpha;
13
14 // Simple remap from-to range.
15 float remap(float value, float low1, float high1, float low2, float high2)
16 {
17 return low2 + (value - low1) * (high2 - low2) / (high1 - low1);
18 }
19
20 void main()
21 {
22 float height = pow(remap(FragPos.y, HEIGHT_MIN, HEIGHT_MAX, 0, 1), 2.2);
23
24 FragColor = vec4(0, height, 1, 1.0);
25 }