PDA

View Full Version : Blending/Depthtes probs



Dies_Irae
02-15-2002, 04:01 AM
Hi,

In my app I have some sphears that fly around, when they hit eachother im creating some flashes (particles)
Like energy pulses.

So, to make those look good i disable depthtesting and blending with GL_SRC_ALPHA,GL_ONE

The problem is that they show above everything. the balls, the world etc.

I only want them have disabled depthtesting to eachother not the rest of the world.

How is that possible?

At the moment, I:

RenderWorld:
glEnable(blend) gldisable(depthtest)
RenderParticles
gldisable(blen) glenable(depthtest)
RenderBalls

Reason why i Render theworld first is else the particles doesnt show at all, they are behind the world.

And the balls after so it seems that they are behind the balls
(Should only be behind one tho)


Thanks

dorbie
02-15-2002, 04:27 AM
Draw the particles last and disable depth writes but keep depth testing on. glDepthMask is what you need for this.