I have two draw functions that both use glsl shaders, one renders a texture and the other a lightmap. When I draw the texture first than modulate the lightmap onto it everything is fine but when I draw the lightmap first there is a weird wireframe-like affect that appears.
fine:
Code :// draw texture glEnable( GL_BLEND ); glBlendFunc( GL_ZERO, GL_SRC_COLOR ); // not sure how this works (from my understanding it should be black cause of the GL_ZERO) // draw lightmap glDisable( GL_BLEND );
has weird wireframe:
Code :// draw lightmap glEnable( GL_BLEND ); glBlendFunc( GL_ZERO, GL_SRC_COLOR ); // draw texture glDisable( GL_BLEND );
I've tried changing some setting such as glShadeModel(/* GL_FLAT and GL_SMOOTH */), glDepthFunc() and glDepthMask() with no change.
I also want to add a third pass that will use "texture" alpha as a mask, I'm not sure how glBlendFunc works entirely so I'm not sure what I should be setting to achieve this effect. I've read it in detail but I still don't understand how it works. Thanks for any help.



