Description
The OverlayWithDepth
field is a member of the SceneRenderLayer
enumeration in the Sandbox namespace. This field represents a rendering layer that is applied after post-processing effects, but still respects the scene's depth information. This allows for elements to be rendered as overlays while maintaining their depth relationships with other scene objects.
Usage
Use the OverlayWithDepth
layer when you need to render elements on top of the scene after post-processing, but still want to maintain depth information. This is useful for effects or UI elements that should appear integrated with the scene's depth, such as certain types of HUD elements or visual effects that need to interact with the scene's geometry.
Example
// Example of using OverlayWithDepth in a rendering context
public class CustomOverlayComponent : Component
{
public override void Render()
{
// Set the render layer to OverlayWithDepth
Render.SetLayer(SceneRenderLayer.OverlayWithDepth);
// Custom rendering logic here
// This will render the component with depth information
}
}