PDA

View Full Version : fastest method of writing depth



zed
11-24-2005, 02:05 PM
whats the fastest method of writing depth info into a texture WRT texture data saying if u write the depthfragment or not?
ie if the textures alpha is 0.0 then dont write depth
if its 1.0 then write depth

ta zed

Relic
11-24-2005, 10:02 PM
GL_ALPHA_TEST.
Or do you mean still render the color but not the depth on those fragments?

zed
11-24-2005, 10:18 PM
no only the depth (this is for a depth texture)
ALPHA TEST would be ideal but
the problem with ALPHA_TEST is i believe it disables early depth rejection thus is slow (1/2 speed) or is this wrong?

ZbuffeR
11-25-2005, 12:24 AM
>> problem with ALPHA_TEST is i believe it disables early depth rejection thus is slow

Thinking about it, there is quite a lot of optimization can't do if you need to access texture data for writing depth ...

Humus
11-26-2005, 01:31 PM
Originally posted by zed:
ALPHA TEST would be ideal but
the problem with ALPHA_TEST is i believe it disables early depth rejection thus is slow (1/2 speed) or is this wrong?It will be disabled regardless if you use alpha test, kill the fragment in the shader or modify the depth in the shader. I don't see any other way to solve the problem so I'm afraid you're out of luck. But it may not be that bad if you don't have a lot of overdraw or only use do this for a subset of the rendering.

zed
11-26-2005, 03:51 PM
so it looks like i stick to what i already have i was hoping for some trickery
anyways thanks guys