1
0
Fork 0
fgdata/Shaders/HDR/geometry.frag

28 lines
614 B
GLSL
Raw Normal View History

2021-04-10 09:14:16 +00:00
#version 330 core
layout(location = 0) out vec4 gbuffer0;
layout(location = 1) out vec2 gbuffer1;
layout(location = 2) out vec4 gbuffer2;
in vec3 normalVS;
in vec2 texCoord;
uniform sampler2D color_tex;
const float DEFAULT_METALNESS = 0.0;
const float DEFAULT_ROUGHNESS = 0.8;
vec2 encodeNormal(vec3 n);
vec3 decodeSRGB(vec3 screenRGB);
2021-04-10 09:14:16 +00:00
void main()
{
gbuffer0.rgb = decodeSRGB(texture(color_tex, texCoord).rgb);
2021-04-10 09:14:16 +00:00
gbuffer0.a = 1.0;
gbuffer1 = encodeNormal(normalVS);
gbuffer2 = vec4(DEFAULT_METALNESS,
DEFAULT_ROUGHNESS,
0.0,
0.0);
}