Description
The Opaque
field is a member of the SceneLayerType
enumeration in the Sandbox namespace. It represents a rendering pass for opaque objects in a scene. Opaque objects are those that do not allow light to pass through, and they are typically rendered first in the rendering pipeline to optimize performance and ensure correct depth sorting.
Usage
Use the SceneLayerType.Opaque
field when you need to specify that a particular rendering operation should handle opaque objects. This is commonly used in rendering pipelines to ensure that opaque objects are processed in the correct order relative to other types of objects, such as translucent or shadow-casting objects.
Example
// Example of using SceneLayerType.Opaque in a rendering context
public void RenderScene(Scene scene)
{
// Set the current rendering layer to Opaque
scene.SetCurrentLayer(SceneLayerType.Opaque);
// Render all opaque objects
foreach (var obj in scene.GetObjectsByLayer(SceneLayerType.Opaque))
{
obj.Render();
}
}