Depth Layer
Some rendering techniques require access to the scene's depth or color buffer for a specific camera. The depth layer is a special layer that can be added to a camera's layers property. The order of the layer defines at which point during rendering the depth or color buffer is captured. The captured buffer can then be used by subsequent layers of the camera.
Typically, these buffers are captured after all opaque layers have been rendered and can be used by subsequent transparent layers or post-processing.
Additionally, to capture these buffers, you need to enable capture in the CameraComponent from a script:
requestSceneColorMap- Request color maprequestSceneDepthMap- Request depth map
Buffer Access
To access one of these buffers as a texture in a shader, you need to use the following uniform names:
- For color map:
uSceneColorMap - For depth map:
uSceneDepthMap