Contents

ModelDebugOptionsComponent.VisualizationMode.lightingDiffuse

A mode that displays the intensity of indirect light hitting the entity as its surface color.

Declaration

case lightingDiffuse

Discussion

Add a ModelDebugOptionsComponent with a visualization mode of lightingDiffuse to an entity to tell RealityKit to draw the intensity of indirect, ambient lighting falling on the entity as its surface color. RealityKit represents the intensity of indirect light as a grayscale value from black (0.0) to white (1.0).

RealityKit calculates diffuse lighting for entities with a SimpleMaterial and for entities imported from a USDZ file. For other entities, this option has no effect.

Here’s how to enable roughness visualization for an entity:

if let television = try? await ModelEntity(named: "tv_retro") {
    let component = ModelDebugOptionsComponent(visualizationMode: .lightingDiffuse)
    television.components.set(component)
}

None

lightingDiffuse

[Image]

[Image]

See Also

Visualization modes