Swap Model Variants
This demonstrates the use of the glTF materials
variants extension which allows multiple materials and textures
to be packed with a single geometry in a GLB. Our API exposes these
variant names as availableVariants
and you can select
one using the variantName
attribute. This is similar
functionality to the lower-level scene-graph API below, but in that
case it is up to you to choose the right texture URL, rather than
having that information stored in the GLB. Note: setting variantName
to null
reverts to the initial material.