Contents

ModelDebugOptionsComponent.VisualizationMode.specular

A mode that displays en entity’s shininess as its surface color.

Declaration

case specular

Discussion

Add a ModelDebugOptionsComponent with a visualization mode of specular to an entity to tell RealityKit to draw the entity’s calculated specularity as its surface color. RealityKit uses specular to calculate bright highlights caused by shiny surfaces reflecting light. RealityKit draws the specularity value as a grayscale value from black (0.0) to white (1.0).

RealityKit calculates specularity 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: .specular)
    television.components.set(component)
}

None

specular

[Image]

[Image]

See Also

Visualization modes