Component reference
Scene Composition components
Variant component
5min
The Variant component allows you to assign multiple 3D models to a single entity and switch between them based on certain conditions, known as heuristics. This is useful for implementing features like level of detail (LOD), device-specific models, or manual model switching through Triggers.
An entity with a Model component is required. The variant component works in conjunction with the model component.
Property | Description |
---|---|
Heuristic | Determines the method used to select which model variant to display. Options include Distance, Scene Scale, Manual, Device, and Budget.
|
Variants | A list of model variant Sources, each with its own source URL and parameters depending on the heuristic. |
- Distance heuristic: Useful for implementing LOD, where high-detail models are used when the user is close, and lower-detail models when farther away.
- Manual heuristic: Allows you to change models in response to user interactions or triggers within the scene.
- Device heuristic: Ideal for optimizing performance across different devices by providing appropriate model qualities for various devices.
- Budget heuristic: Automatically adjusts model variants based on system performance, which can help maintain a smooth user experience.
- When using the Distance heuristic, overlapping distance ranges can cause unexpected behavior. Ensure that the Minimum distance and Maximum distance values for variants do not overlap.
- The Budget heuristic is advanced and may require testing to ensure it works as expected in your scene.
Updated 06 Dec 2024
Did this page help you?