PDA

View Full Version : Correct transparency



KRONOS
06-02-2000, 12:46 PM
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?

Humus
06-02-2000, 02:44 PM
By disabling writes to the depthbuffer with glDepthMask(GL_FALSE);

06-03-2000, 06:59 AM
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

KRONOS
06-03-2000, 11:48 AM
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...

Kaeto
06-03-2000, 05:19 PM
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