Stacking 3D elements in a composition
A Composition can be composed of various 3D elements:
- 2D layers that were switched to 3D
- Camera and Light layers
- 3D Asset layers which link to an Asset 3D in the Project Panel
- Sub-composition only composed of 3D elements
Consecutive 3D elements in a Composition form a 3D Scene. The output image of those consecutive 3D elements is a render of the scene through a camera. The camera chosen is the topmost active Camera layer in the Layer Stack.
This means that the visibility of consecutive 3D elements is now driven by their depth in the scene and not by their position in the Layer Stack.
A 3D Scene is automatically created for all consecutive 3D elements in the Layer Stack. If a 2D Layer is between 2 sets of 3D Layers, 2 scenes are created and two 3D renders are made.
A Camera is also automatically created to render the 3D Scene if there is none in the Layer Stack. By default, this Camera is placed to render a plane exactly the size of the Composition.
When switching the Composition to 3D Mode, all 3D composition elements (consecutive or not) will be merged into one unique scene. However, this is only to help position all 3D elements overall, and is not a real representation of the Composition render in 2D Mode. An element that may seem in front in 3D Mode can still be hidden in the Composition render!
In the example below, a 2D Layer (Circle) is between two 3D Asset Layers (Sphere3D and Cube3D). Even if the Sphere is behind the Cube in 3D Mode, it still appears in front in the 2D Composition render.
This is due to Sphere3D and Cube3D not being consecutive 3D elements. The order of action in the Layer Stack is:
- Render of the Cube3D Scene (which only contains the cube) into an image.
- Render of the Circle onto the previous image.
- Render of the Sphere3D Scene (which only contains the sphere) onto the previous image.