Sprite check specular and diffuse intensity for discard
@@ -3,15 +3,16 @@ uniform sampler2DArray tex;
in vec2 uv;
layout (location = 0) out vec4 out_color;
-layout (location = 1) out vec4 normal;
+layout (location = 1) out vec4 out_normal;
void main()
{
vec4 color = texture(tex, vec3(uv, 0.0));
- if(color.a < 0.01) { // Test depth instead
+ vec4 normal = texture(tex, vec3(uv, 1.0));
+ if(color.a < 0.01 && normal.a < 0.01) { // No diffuse or specular intensity. Test depth instead?
discard;
}
out_color = color;
- normal = texture(tex, vec3(uv, 1.0));
+ out_normal = normal;
// Maybe update depth as well?
}
