GRK_Room/cw 9/shaders/test.frag

21 lines
466 B
GLSL
Raw Normal View History

2023-01-14 12:00:59 +01:00
#version 330 core
out vec4 FragColor;
in vec2 tc;
2023-01-30 12:10:43 +01:00
uniform sampler2D color;
uniform sampler2D highlight;
2023-01-14 12:00:59 +01:00
2023-01-16 17:25:19 +01:00
float rescale_z(float z){
float n = 0.05;
float f = 20.;
return (2*n*f/(z*(n-f)+n+f))/f;
}
2023-01-14 12:00:59 +01:00
void main()
{
2023-01-30 12:10:43 +01:00
//float depthValue = texture(depthMap, tc).r;
2023-01-23 12:11:20 +01:00
//FragColor = vec4(vec3(rescale_z(depthValue)+0.5), 1.0);
2023-01-30 12:10:43 +01:00
//FragColor = vec4(vec3((depthValue)+0.5), 1.0);
FragColor = vec4( texture(highlight, tc));
2023-01-14 12:00:59 +01:00
}