I’m currently implementing a deferred shader with multiple render targets for albedo, normal and position. The depth test fails as soon as I set the “alpha” value for the normal or position texture to zero. How can I tell OpenGL to use only the albedo texture for its depth tests? Or am I thinking in the wrong direction?
Depth Test is enabled during geometry render (glEnable(GL_DEPTH_TEST)) and disabled when I call the deferred shading.
My Setup for the depth looks like this:
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, dim, dim);
and my fragment shader to fill the MRT:
lo_fragcolor1 = texture(u_texture, gs_texcoord);
lo_fragcolor2 = vec4(normalize(gs_normal) * 0.5 + 0.5, 0);
lo_fragcolor3 = vec4(gs_position, 0);