Hi there!
I have just written a particle system which uses textured quads. I''m loading a tga and blending it using:
glDepthMask(0)
glBlendFunc(GL_SRC_ALPHA,GL_ONE)
renderparticles()
glDepthmask(1)
this blends the particles nicely, but I have models behind the particle system which should be partially obscured but are not due to the depth mask. What is the best way to get around this???
Thanks in advance!
The models aren''t obscured becuase you''re only adding color a''la a light effect. If you wanna obscure the background, you''ll need to use your source alpha to block out the background. GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA would seem to be appropriate (altho I like GL_ONE, GL_ONE_MINUS_SRC_ALPHA). This has the effect, tho, of making your particle drawing order somewhat important. You may need to sort your particles to draw back to front, but that''ll depend really on the actual effect you''re looking for.