I've got the following weird issue.
I'm trying to implement multipass lighting and I encountered some sort of Z-fighting issue. I perform one ambient/diffuse pass with glDepthFunc(GL_LESS) and then a additive light pass with glDepthFunc(GL_EQUAL) with depth writes disabled. When I pan my camera around, I get huge flickering artifacts.
The vertex shader for the light pass contains:
uniform mat4 uModel;uniform mat4 uView;uniform mat4 uProjection; void main() {aPosition = uView * uModel * vPosition;gl_Position = uProjection * aPosition;
I'd pass aPosition to the fragment shader to do the lighting with. When I change this to:aPosition = uView * uModel * vPosition;gl_Position = uProjection * uView * uModel * vPosition;
it suddenly works without flickering. What's going on?Does an assignment inbetween some math expressions create errors?
Thanks a bunch!