Polygon Offset is an OBJ modeling feature that allows you to stack multiple layers of polygons on top of each other without flicker. Polygon offset is set in an OBJ file via an ATTRibute (ATTR_poly_os) but is usually set using a plugin or script for your modeling program.
Legal polygon offset values are 0 (no offset) or positive integers.
The polygon offset value does not define a layer order. It does define the “strength” of anti-Z-thrashing applied; generally you should use the smallest number you can get away with to avoid other artifacts.
Draw Order and Polygon Offset
It is critical that the draw order of any geometry with polygon offset is:
- The base geometry.
- All overlay layers, in the order they should be overdrawn. All overlay layers should have the same polygon offset values!
- Any geometry that appears on top of the overlay (e.g. 3-d elements on top of the flat elements).
Within an Object
Within an object, X-Plane respects the draw order you pick, so be sure to order your geometry based on the above rules.
Within an Airplane
Within an airplane, the draw order is based on:
- Outside cockpit object
- Outside-lighting objects, by order in the attachment dialog box.
- Inside-lighting objects, by order in the attachment dialog box.
- Inside cockpit object
- Glass-lighting objects, by order in the attachment dialog box.
Within Scenery
Objects are sorted by the ATTR_layer_group directive; within a layer group, the order is determined by X-Plane.