Component reference
Scene Composition components

Variant component

5min

Description

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.

Document image



Requirements

An entity with a Model component is required. The variant component works in conjunction with the model component.

Properties

Property

Description

Heuristic

Determines the method used to select which model variant to display. Options include Distance, Scene Scale, Manual, Device, and Budget.

  • Distance: This option switches models based on the user's distance from the entity. Each variant has Minimum and Maximum distance parameters.
  • Scene Scale: As of v1.0 of the platform, scene scale is not working as intended.
  • Manual: Allows manual control of the displayed model through triggers or scripts.
  • Device: Selects models based on the user's device type (e.g., desktop, mobile, XR headset).
  • Budget: Automatically manages model quality based on the performance budget, adjusting models to maintain optimal frame rates. (Note: May require further testing to ensure proper functionality.)

Variants

A list of model variant Sources, each with its own source URL and parameters depending on the heuristic.

Usage notes

  • 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.

Important details

  • 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.