PDA

View Full Version : Transparency



devdept
11-15-2006, 04:50 AM
Hi All,

The last time I dealed with transparency I knew I need to sort all the triangles by their distance from the view point.

Now some years are passed, is there any news on this technique? Any extension that can sort triangles on the hardware side?

Thanks,

Alberto

Zengar
11-15-2006, 06:11 AM
You may look here: http://developer.nvidia.com/object/Interactive_Order_Transparency.html

zeoverlord
11-15-2006, 06:14 AM
nope, it has actually gotten slightly worse on this side, though today it doesn't really matter since most renderings are more fillrate limited than before, meaning that you can sort a limited number of polygons without it being to bad.

+ fillrate limited rendering and higher polygon counts means that transparent areas could be covered by a polygonal object instead of a texture object, meaning in reality less(percentage wise that is) or more easily sorted transparent polygons.

- The recent geometry shaders and the fact that graphics cards can now process polygons slightly out of order means that sorting might not be that reliable any more unless you where somehow to write a geo program that sort's them (have not tried this though).

Though i am hoping this issue might soon be addressed, geometry shaders certainly adds an important stage to the solution of this problem.


Edit: what Zengar is describing is a method called depth pealing, and while it requires no sorting and works in all(read:most) situations, the rendering speed is far from optimal as you have to render the entire scene 10 or so times and use some rather expensive compositing methods.

devdept
11-15-2006, 11:05 AM
Thanks guy,

Let's narrow the field: suppose I need to render both opaque and translucent objects that does not itersect but can be one inside the other: does the technique described inside the opengl programming guide fit my needs?

I attach the red book words:

"The solution is to enable depth buffering but make the depth buffer read-only while drawing the translucent objects. First you draw all the opaque objects, with the depth buffer in normal operation. Then you preserve these depth values by making the depth buffer read-only. When the translucent objects are drawn, their depth values are still compared to the values stablished by the opaque objects, so they aren't drawn if they're behind the opaque ones. If they're closer to the viewpoint, however, they don't eliminate the opaque objects, since the depth-buffer values can't change. Instead, they're blended with the opaque objects. To
control whether the depth buffer is writable, use glDepthMask(); if you pass GL_FALSE as the argument, the buffer becomes read-only, whereas GL_TRUE restores the normal, writable operation."

Thanks so much again, ;)

Alberto