2014-12-18 16:09:14 -05:00
|
|
|
#ifndef Use_Bindless_Texture
|
2014-08-25 12:20:37 -04:00
|
|
|
uniform sampler2D tex;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
in vec2 uv;
|
|
|
|
in vec3 nor;
|
|
|
|
in vec4 color;
|
2014-12-18 16:09:14 -05:00
|
|
|
#ifdef Use_Bindless_Texture
|
2014-08-25 12:20:37 -04:00
|
|
|
flat in uvec2 handle;
|
|
|
|
#endif
|
|
|
|
layout (location = 0) out vec3 RSMColor;
|
|
|
|
layout (location = 1) out vec3 RSMNormals;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2014-12-18 16:09:14 -05:00
|
|
|
#ifdef Use_Bindless_Texture
|
2014-08-25 12:20:37 -04:00
|
|
|
vec4 col = texture(sampler2D(handle), uv);
|
|
|
|
#ifdef SRGBBindlessFix
|
|
|
|
col.xyz = pow(col.xyz, vec3(2.2));
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
vec4 col = texture(tex, uv);
|
|
|
|
#endif
|
|
|
|
if (col.a < .5) discard;
|
|
|
|
RSMColor = col.xyz * color.rgb;
|
|
|
|
RSMNormals = .5 * normalize(nor) + .5;
|
|
|
|
}
|