ModelDebugOptionsComponent.VisualizationMode.roughness
A mode that displays the shininess of a material as the surface color.
Declaration
case roughnessDiscussion
Add a ModelDebugOptionsComponent with a visualization mode of roughness to an entity to tell RealityKit to draw that entity’s roughness value as its surface color. A high roughness value represents a surface with a matte finish, while a low roughness value represents a shiny or polished surface. When using this mode, RealityKit draws the roughness value as a grayscale value from black (0.0) to white (1.0), meaning the shinier a part of the entity is, the darker RealityKit draws it.
RealityKit calculates roughness for entities with a SimpleMaterial and for entities imported from a USDZ file. For other entities, this option has no affect.
Here’s how to enable roughness visualization for an entity:
if let television = try? await ModelEntity(named: "tv_retro") {
let component = ModelDebugOptionsComponent(visualizationMode: .roughness)
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.metallicModelDebugOptionsComponent.VisualizationMode.ambientOcclusionModelDebugOptionsComponent.VisualizationMode.specularModelDebugOptionsComponent.VisualizationMode.emissiveModelDebugOptionsComponent.VisualizationMode.clearcoatModelDebugOptionsComponent.VisualizationMode.clearcoatRoughnessModelDebugOptionsComponent.VisualizationMode.lightingDiffuse