Contents

ModelDebugOptionsComponent.VisualizationMode.metallic

A mode that displays the reflectiveness of an entity as its surface color.

Declaration

case metallic

Discussion

Add a ModelDebugOptionsComponent with a visualization mode of metallic to an entity to tell RealityKit to draw that entity so the surface color indicates whether that part of the object reflects the surrounding environment.

RealityKit draws the quality of metallicity as a grayscale value from black (0.0) to white (1.0), rendering the reflective parts of the entity in white and the nonreflective parts in black.

RealityKit calculates metallic values 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 metallic visualization for an entity:

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

None

metallic

[Image]

[Image]

See Also

Visualization modes