ModelDebugOptionsComponent.VisualizationMode.tangent
A mode that displays the surface tangent vectors as a color.
Declaration
case tangentDiscussion
Add a ModelDebugOptionsComponent with a visualization mode of tangent to an entity to tell RealityKit to draw that entity’s calculated tangent vectors as its surface color. A tangent vector is an imaginary line that touches, but doesn’t intersect with the surface of the object at a specific point. RealityKit draws a tangent vector by using its X, Y, and Z values as the R, G, and B components of the color.
RealityKit calculates tangents for entities with a VideoMaterial, UnlitMaterial, or SimpleMaterial as well as for entities imported from a USDZ file. If an entity doesn’t fall within those parameters, this option has no effect on the rendering.
Here’s how to enable tangent visualization for an entity:
if let television = try? await ModelEntity(named: "tv_retro") {
let component = ModelDebugOptionsComponent(visualizationMode: .tangent)
television.components.set(component)
}
| |
|---|---|
[Image] | [Image] |
See Also
Visualization modes
ModelDebugOptionsComponent.VisualizationMode.noneModelDebugOptionsComponent.VisualizationMode.normalModelDebugOptionsComponent.VisualizationMode.bitangentModelDebugOptionsComponent.VisualizationMode.baseColorModelDebugOptionsComponent.VisualizationMode.textureCoordinatesModelDebugOptionsComponent.VisualizationMode.finalColorModelDebugOptionsComponent.VisualizationMode.finalAlphaModelDebugOptionsComponent.VisualizationMode.roughnessModelDebugOptionsComponent.VisualizationMode.metallicModelDebugOptionsComponent.VisualizationMode.ambientOcclusionModelDebugOptionsComponent.VisualizationMode.specularModelDebugOptionsComponent.VisualizationMode.emissiveModelDebugOptionsComponent.VisualizationMode.clearcoatModelDebugOptionsComponent.VisualizationMode.clearcoatRoughnessModelDebugOptionsComponent.VisualizationMode.lightingDiffuse