SceneRenderLayer OverlayWithDepth

book_4_sparkGenerated
code_blocksInput

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 depth interactions with the scene.

Usage

Use the OverlayWithDepth layer when you need to render elements that should appear as overlays but still interact with the scene's depth. This is particularly useful for UI elements or effects that need to be integrated into the scene's depth, such as shadows or highlights that should appear behind or in front of certain objects based on their depth.

Example

// Example of using SceneRenderLayer.OverlayWithDepth

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 as an overlay with depth
    }
}