ao, shadows, height override entities, vdf multiple keyvalue patch, cover visgroup
[tar-legacy.git] / MCDV / shaders / depth.fs
1 #version 330 core
2 out vec4 FragColor;
3
4 uniform vec3 color;
5
6 uniform float HEIGHT_MIN;
7 uniform float HEIGHT_MAX;
8 uniform float write_playable;
9 uniform float write_cover;
10
11 in vec3 FragPos;
12 in float Depth;
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(write_playable, height, write_cover, 1);
25 }