Correct transparency

i’m trying to create a flame. I draw a cross
made out of two QUADS and i apply the texture. Everything is correct except that the transparency of one flame blocks the other!!! How can get multiple transparent
objects the be drawn correctly?

By disabling writes to the depthbuffer with glDepthMask(GL_FALSE);

You can draw from furthest from camera view to closet to camera view.

example

if your first object is located at 10,0,0
your second object is located at 15,0,0
camera is located at 0,0,0

then draw object 2
then draw object 1

if your first object is located at 15,0,0
your second object is located at 10,0,0

then draw object 1
then draw object 2

remember to draw objects from back to front (furthest to closest)

Dans

Originally posted by Humus:
By disabling writes to the depthbuffer with glDepthMask(GL_FALSE);

but then i can see the flames throw walls
i don’t want that…

Draw the flames dead last, after all other scene objects (but before the HUD, if you have one), and disable the depth buffer just before you draw them, then enable when you’re done