Draw Order Within an OBJ

Draw order within an X-Plane object is deterministic – X-Plane always draws objects in the order of their command structure. Therefore you can control draw order using your 3-d modeling tool.

  • The ac3d exporter will export models in the order shown in the hierarchy view.
  • The Blender exporter will sort your model, but will keep groups separated, and will put mesh triangles marked “alpha” last.
    • LR’s modified blender exporter for v10 (to be staged with v10 – contact LR if you want to merge the changes into another distro) sorts triangles back to front and front to back to help make translucent surfaces work.

X-Plane 10 Only: the order of additive LODs is not guaranteed; X-Plane may draw the LODs in any order.

Layer Groups and Draw Order Between OBJs

All art assets in X-Plane belong to a layer group. Layer groups are always drawn in order, but within a layer group the draw order is unpredictable. This means:

  • You can force one object to always be drawn before another by putting it in a lower layer group (using ATTR_layer_group).
  • You cannot dynamically change the draw order at runtime – you must pick which object is drawn first.
  • You cannot change the draw order based on camera angle.

Note that using layer groups disables X-Plane’s ability to optimize object draw order for performance (because it forces a particular, possibly non-optimal draw order); use layer groups only where you must use them for correct visual output.

Meta

Topic:

  • Scenery

Article type:

  • Guide