Alpha Sort Buckets Lab

What's Happening

This lab demonstrates the effect that Alpha Sort order has on objects with transparency. When the sort order of all three buckets is set to zero (the default), the closest object (determined by the distance to the object's center point) will appear in front. Click and drag within the scene to change the angle of the bucket stack. When the camera is above the yellow bucket's centerpoint, the red bucket will be closer than the yellow bucket (as in the illustration below), but the yellow bucket should appear in front, since the red bucket is partially inside the yellow one. The effect this produces looks like something out of an Escher print; the red bucket appears to be both inside and in front of the yellow bucket.

To correct this problem, set the Alpha sort order of the red bucket to 1, the yellow one to 2, and the blue to 3. This will cause the buckets to render in the proper order (the red bucket first, followed by the yellow one, and the blue bucket last), regardless of their distance to the camera.

Key Methods used

WTActor::setOption

Points to Remember