2018-02-15 09:59:38 +01:00
|
|
|
#version 330 core
|
|
|
|
|
2018-02-16 11:35:09 +01:00
|
|
|
in vec2 ioUV;
|
2018-02-15 09:59:38 +01:00
|
|
|
|
2018-02-16 11:35:09 +01:00
|
|
|
out vec3 outColor;
|
2018-02-15 09:59:38 +01:00
|
|
|
|
2018-02-16 11:35:09 +01:00
|
|
|
uniform sampler2D uTexture;
|
|
|
|
uniform float uNear;
|
|
|
|
uniform float uFar;
|
2018-02-15 09:59:38 +01:00
|
|
|
|
|
|
|
void main() {
|
2018-02-16 11:35:09 +01:00
|
|
|
float z = texture(uTexture, ioUV).r;
|
2018-02-17 23:49:56 +01:00
|
|
|
float c = (z - uNear) / (uFar - uNear);
|
2018-02-16 11:35:09 +01:00
|
|
|
|
|
|
|
outColor = vec3(c);
|
2018-02-15 09:59:38 +01:00
|
|
|
}
|