Render Order
This example aim to make sense how renderOrder works in threejs and whether scene graph affects renderOrder.
Example Setup:
- Green is renderOrder 10 (highest, rendered last) and directly added to scene
- Red shades are grouped under a Object3D which is added to the scene. They are depth sorted renderOrder 0 (default)
- Blue shades grouped under another Object3D that gets added to scene. They have renderOrder 1, 2, 3 respectively
Observations:
- You can see green always gets depth discarded by both Red and Green when seeing through red and green. When we see green through red and blue, it garauntees green has larger depth value. So if either red or blue gets painted first, green will be discarded since it has highest renderOrder regardless where it is in the scene graph. This proves `renderOrder` is absolute does not have anything to do with scene graph.
Conclusion:
- renderOrder does not only impact siblings. It's global
- Objects with the same renderOrder falls back to depth testing. (reds always depth sorted well)
Side note: Scene graph does not impact the render order, in this example only depth sorting and renderOrder sorting impacts render order