SceneRenderLayer OverlayWithDepth

robot_2Generated
code_blocksInput

Description

The OverlayWithDepth field is a member of the SceneRenderLayer enumeration in the Sandbox namespace. It represents a rendering layer that overlays content after post-processing while still respecting the scene's depth information. This allows for elements to be drawn on top of the scene but still interact with the depth buffer, ensuring proper occlusion and depth-based effects.

Usage

Use SceneRenderLayer.OverlayWithDepth when you need to render elements that should appear on top of the scene but still require depth testing. This is particularly useful for UI elements or effects that need to be integrated with the scene's depth, such as holograms or heads-up displays (HUDs) that should be occluded by scene geometry.

Example

// Example of using SceneRenderLayer.OverlayWithDepth
public class MyOverlayComponent : Component
{
    public override void Render()
    {
        // Set the render layer to OverlayWithDepth
        Render.SetRenderLayer(SceneRenderLayer.OverlayWithDepth);

        // Render your overlay content here
        // This content will be drawn after post-processing but will respect the scene's depth
    }
}