With transparency sometimes polygons display order changes...

Started by entis, February 13, 2008, 11:01:13 AM

Previous topic - Next topic

entis

Hi,

While using transparency with sw renderer I get such a strange effect when I change my angle of view on some object - polygons display order changes, please see the picture... by the way there is no such effect when I turn off the transparency.. :(
Tell me what's wrong.. Thanks in advance.


EgonOlsen

Both overlapping parts are set to transparent or just one of them?


EgonOlsen

Transparent objects read from the Zbuffer, but don't write to it (that wouldn't make sense, because it would exclude anything behind them that is drawn later). So when sorting transparent objects before rendering, this happens based on an average depth, not on the per-pixel-depth. This sorting (http://en.wikipedia.org/wiki/Painter's_algorithm) isn't perfect in all cases, which is why it leads to incorrect overlapping. You can't really fix it, but you can try to play around with the setSortOffset(<float>)-method in Object3D. Try to give the metal bars (or whatever they are...) some offset and see if that helps. If it doesn't, try to separate the bars from the panel (i.e. don't place the panel so close to the bars as it is now) and see if that reduces or eliminates the problem.

entis