func_detail, compositor shuffle, better kernal filters
[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
10 in vec3 FragPos;
11 in float Depth;
12
13 // Simple remap from-to range.
14 float remap(float value, float low1, float high1, float low2, float high2)
15 {
16 return low2 + (value - low1) * (high2 - low2) / (high1 - low1);
17 }
18
19 void main()
20 {
21 float height = pow(remap(FragPos.y, HEIGHT_MIN, HEIGHT_MAX, 0, 1), 2.2);
22
23 FragColor = vec4(write_playable, height, 0, 1);
24 }