PDA

View Full Version : masked blending and fog



Polymorph
02-06-2002, 03:41 AM
I am drawing some quads in a foggy scene fogcolor={1.0f,1.0f,1.0f,1.0f} that use two textures for blending. A black and white mask for GL to know what to blend and the real texture. I keep the quads' vertices in a z sorted (back to front) array. For blending I have two rendering passes where I draw the mask texture first using glBlendFunc (GL_DST_COLOR, GL_ZERO) and in the second pass I change to my real texture and set the blending function to glBlendFunc(GL_ONE, GL_ONE). it works perfectly if I disable the fog, but if I turn it on I have white borders around my quads which exactly are the part that does NOT get drawn when I disable the fog. are there special things I have to consider when I do blending with fog enabled? note: my fog is white, so I guess it somehow confuses GL's blending when I render my black and white mask texture. I don't know what to do, I have already tried to somehow change the blending functions, but none of the combinations I used worked http://www.opengl.org/discussion_boards/ubb/frown.gif I am pretty new to OpenGL, so I'm stuck at this point.