Author Topic: With transparency sometimes polygons display order changes...  (Read 4305 times)

Offline entis

  • byte
  • *
  • Posts: 32
    • View Profile
With transparency sometimes polygons display order changes...
« on: February 13, 2008, 11:01:13 am »
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.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: With transparency sometimes polygons display order changes...
« Reply #1 on: February 13, 2008, 11:26:21 am »
Both overlapping parts are set to transparent or just one of them?

Offline entis

  • byte
  • *
  • Posts: 32
    • View Profile
Re: With transparency sometimes polygons display order changes...
« Reply #2 on: February 13, 2008, 11:33:45 am »
Both

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: With transparency sometimes polygons display order changes...
« Reply #3 on: February 13, 2008, 03:51:44 pm »
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.
« Last Edit: February 13, 2008, 04:07:26 pm by EgonOlsen »

Offline entis

  • byte
  • *
  • Posts: 32
    • View Profile
Re: With transparency sometimes polygons display order changes...
« Reply #4 on: February 13, 2008, 04:10:17 pm »
Thanks, I'll try to play with settings...