depth peeling

i wanna do order independent transparency via depth peeling, i read the paper from:

http://developer.nvidia.com/attach/6402

the ideas of taking corss sections makes sence, but thier pesudo code doesn’t.

they have depth unit 0 and 1, which i assume are the depth textures (shadow maps)… but we cant render to depth buffers, so i’m a little confused as to whats happening? (page 8 on the pdf btw)

also it says:
disable or enable depth test, (implys depth func = GL_NONE)
then it goes to say: set depth func to greater, (implys depth func = GL_GREATER)? so wtf?

Originally posted by supagu:
but we cant render to depth buffers, so i’m a little confused as to whats happening? (page 8 on the pdf btw)
You can but only on Nvidia cards (GF3+), if you want to support other cards you have to use glCopyTexSubImage2D on a texture of type GL_DEPTH_COMPONENT

For the second question if you read carefully it says disable depth write not depth test.

so what they are suggesting is best case senario, so i should en dup doing seomthing like:

render first pass with depth test on and depth write on, copy colour buffer to a texture, copy depth to a depth texture.

then for every other pass, clear depth buffer, set depth test to somehow be greater then that in the depth texture, but some how to store the smallest value in the depth buffer. and copy colour buffer to a texture

then blend all layers back to screen.

the second part is the tricky part which needs to use texture comparisons i guess - using GL_ARB_shadow, i guess im gonna have to project the depth map back on to the scene similar to shahdow mapping?