ModelDebugOptionsComponent.VisualizationMode.ambientOcclusion
A mode that displays the calculated ambient occlusion value as the surface color.
Declaration
case ambientOcclusionDiscussion
Add a ModelDebugOptionsComponent with a visualization mode of ambientOcclusion to an entity to tell RealityKit to draw the calculated ambient occlusion values as the entity’s surface color. Ambient occlusion represents the entity’s exposure to ambient light. RealityKit draws ambient occlusion values as a grayscale value from black (0.0) to white (1.0), rendering flat surface areas in white, and crevices, dents, and recessed areas in darker shades.
RealityKit calculates ambient occlusion 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 ambient occlusion visualization for an entity:
if let television = try? await ModelEntity(named: "tv_retro") {
let component = ModelDebugOptionsComponent(visualizationMode: .ambientOcclusion)
television.components.set(component)
}
| |
|---|---|
[Image] | [Image] |
See Also
Visualization modes
ModelDebugOptionsComponent.VisualizationMode.noneModelDebugOptionsComponent.VisualizationMode.normalModelDebugOptionsComponent.VisualizationMode.tangentModelDebugOptionsComponent.VisualizationMode.bitangentModelDebugOptionsComponent.VisualizationMode.baseColorModelDebugOptionsComponent.VisualizationMode.textureCoordinatesModelDebugOptionsComponent.VisualizationMode.finalColorModelDebugOptionsComponent.VisualizationMode.finalAlphaModelDebugOptionsComponent.VisualizationMode.roughnessModelDebugOptionsComponent.VisualizationMode.metallicModelDebugOptionsComponent.VisualizationMode.specularModelDebugOptionsComponent.VisualizationMode.emissiveModelDebugOptionsComponent.VisualizationMode.clearcoatModelDebugOptionsComponent.VisualizationMode.clearcoatRoughnessModelDebugOptionsComponent.VisualizationMode.lightingDiffuse