Efficient translucency...

Started by
5 comments, last by GenPFault 17 years, 1 month ago
I'm trying to create a simple OBJ renderer and hit a snag with per-layer/group translucency. Right now I'm just tossing each layer/group into its own display list for performance reasons, but rendering them in no particular order rarely looks correct. Models are quite large, on the order of 10000+ triangles, and are usually entirely in-frame. Apparently to use the built-in blending modes correctly you have to sort your translucent geometry from back to front before rendering. Unfortunately the only way I've read to do this is to use a BSP tree for my geometry, and rendering them requires a whole bunch of immediate-mode OpenGL calls, one for each polygon (unless I'm misunderstanding something). Is there some easy way to do correct translucency in OpenGL without sorting? If not, is there an easier/quicker way than using BSP trees?
Advertisement
I was just going to ask, Is there a way to map an alpha of > .9 to not do any depth buffer writing. That way if something is clear, I dont have to draw it last.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Quote:Original post by dpadam450
I was just going to ask, Is there a way to map an alpha of > .9 to not do any depth buffer writing. That way if something is clear, I dont have to draw it last.


This maybe? Under 'Another Good Trick':
http://www.sjbaker.org/steve/omniv/alpha_sorting.html
i have had to handle the same situation. I simply sorted my groups so that transparent groups where drawn last. I also turn on back face culling fro transparent groups. You can also disable drawing to the color buffer the first pass, then set your depth function to equal and do another pass. Sorting polygons is almost never the most efficient way to do transparency IMHO.
Quote:Original post by MaliciousDigit
i have had to handle the same situation. I simply sorted my groups so that transparent groups where drawn last. I also turn on back face culling fro transparent groups. You can also disable drawing to the color buffer the first pass, then set your depth function to equal and do another pass. Sorting polygons is almost never the most efficient way to do transparency IMHO.

I would sort groups but they tend to be non-convex and like to wrap around each other is novel ways.
Do depth peeling then. It's simular to what I described with the depth buffer, here's a paper on it.
Quote:Original post by MaliciousDigit
Do depth peeling then. It's simular to what I described with the depth buffer, here's a paper on it.

Thanks for the link, but it looks like that method won't work on low-end and non-Nvidia hardware. The java3d scenegraph solves this somehow, I'll have to go back and look at it. It may just be sorting the layers like you said, in which case I'll have to give it a try.

This topic is closed to new replies.

Advertisement