book_4_sparkGenerated
code_blocksInput

Description

The Opaque field is a member of the SceneLayerType enumeration in the Sandbox API. It represents a rendering pass for opaque objects within a scene. Opaque objects are those that do not allow light to pass through, and thus, they are rendered without any transparency effects.

Usage

Use the SceneLayerType.Opaque when you need to specify that a particular rendering pass should handle opaque objects. This is typically used in rendering pipelines where different types of objects (opaque, translucent, etc.) are processed in separate passes to optimize rendering performance and visual quality.

Example

// Example of using SceneLayerType.Opaque in a rendering context

void RenderScene(Scene scene)
{
    // Set the current rendering layer to Opaque
    scene.SetLayer(SceneLayerType.Opaque);
    
    // Render all opaque objects
    foreach (var obj in scene.GetObjectsByLayer(SceneLayerType.Opaque))
    {
        obj.Render();
    }
}