Friday, October 16, 2009

Order Independent Transparency - What It Fixes

Yesterday I blogged about Order Independent Transparency (OIT). That robot is very shiny, but what does this fix in X-Plane itself? Here are two pictures that show the problem in an X-Plane context.

This is the Cirrus jet in X-Plane 9.22.

Pretty, eh? But...look through the right two windows - look at the passenger door on the other side. Note that through the middle window the passenger door is visible. Through the right window, the entire passenger door is gone!

This is the same shot from X-Plane 940, where the problem has been corrected.

The bug you see here is incorrect draw order. In X-Plane 922, the right door (which contains the right-most near window) is drawn before the left door - hence its translucent part destroys the door.

Max fixed this by changing the draw order of the model - the new cirrus draws the inside view of both doors before the outside view of either doors; because the geometry is one-sided he can draw the 'inside' first and outside 'second'.

These two blog posts explain translucency in a lot more detail.

What X-Plane has now is "order dependent" transparency - if translucent surfaces are not drawn from far to near, you get artifacts like the missing door.

What OIT promises (and that robot demonstrates) is the ability to have translucent geometry and not have the objects behind the translucent parts disappear.


Anonymous said...

Interesting to see the phenomena appear in a visual example. Keep up the good work!

AJ said...

Order-independent transparency is great---but will its implementation mean losing the ability to use order-dependent transparency to achieve certain clipping effects (ie, for a head-up display)?

Benjamin Supnik said...

AJ - while clipping via transparency is _not_ intentional, my guess is that you can still do it...because OIT will be an option you must turn on. From my understanding, OIT will consume more hw resources, so fill rate will be faster without it.