Description
The OverlayWithoutDepth
field is a member of the SceneRenderLayer
enumeration in the Sandbox namespace. This field represents a rendering layer that is used to draw objects on top of everything else in the scene, after post-processing effects have been applied, but without considering the scene's depth. This means that objects rendered in this layer will appear over all other objects, regardless of their position in 3D space.
Usage
Use the OverlayWithoutDepth
layer when you need to render UI elements or other objects that should always appear on top of the scene, without being affected by the scene's depth. This is particularly useful for HUD elements, crosshairs, or any other overlay that should not be occluded by other scene objects.
Example
// Example of using OverlayWithoutDepth in a custom rendering setup
public class CustomOverlayComponent : Component
{
public override void Render()
{
// Set the render layer to OverlayWithoutDepth
Render.SetRenderLayer(SceneRenderLayer.OverlayWithoutDepth);
// Render your custom overlay elements here
// For example, draw a simple rectangle on the screen
Render.DrawRect(new Rect(10, 10, 100, 50), Color.Red);
}
}