Adding support for the glTF 2.0 KHR_materials_variants extension

Description of the problem

Facebook has been putting together a proposal for a new glTF 2.0 extension that will allow melding multiple material variants for a model into a single glTF/GLB: KhronosGroup/glTF#1681

It’s being proposed as a Facebook vendor extension at the moment with the eventual goal to promote it to an EXT extension. There hoping to start adding support for the extension across various 3D viewers and asset content creation tools. Having it be part of three.js would be a great way to reduce model file size – especially for commerce experiences where it can be common for models to share geometry but have different materials (ie. Selecting different colors of shoes).

@zellski @mikkoh @pushmatrix @richardmonette

Three.js version

  • Dev
  • r109

Browser

  • All of them
  • Chrome
  • Firefox
  • Internet Explorer

OS

  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Author: Fantashit

6 thoughts on “Adding support for the glTF 2.0 KHR_materials_variants extension

  1. I would like to add the KHR_materials_variants extension to the webgl_loader_gltf_extensions example.
    I am concerned about the bloat of the repository by adding sample models.
    The size of the model is a bit large, but I’d like to use the famous shoes as a sample for this glTF extension, is that OK?
    As for the other samples, the chair samples are a little smaller in size.

    Shoes : 7.47 MB (glTF-Binary)
    https://github.com/pushmatrix/glTF-Sample-Models/tree/master/2.0/MaterialsVariantsShoe

    Chair : 1.75 MB (glTF-Binary)
    https://github.com/pushmatrix/glTF-Sample-Models/blob/master/2.0/MaterialsVariantsChair

  2. I’d suggest starting a new example — the source code for webgl_loader_gltf_extensions is already too long to be instructive for new users. Perhaps webgl_loader_gltf_variants? The shoe example could probably be optimized down to <2 MB. If that plan is OK with everyone, I can make a smaller version of the model.

Comments are closed.