Used to create a GLTFScenesManager from a given gltf object.

Parse the gltf object, create all the Sampler and Texture, create all the Object3D nodes to compute the correct transformations and parent -> child relationships, create all the needed MeshDescriptor containing the Geometry, LitMesh parameters and so on.

  • [x] Accessors
    • [x] Sparse accessors
  • [x] Buffers
  • [x] BufferViews
  • [x] Images
  • [x] Meshes
  • [x] Nodes
  • [x] Primitives
    • [x] Compute flat normals if normal attributes is missing
    • [x] Compute tangent space in fragment shader if tangent attributes is missing and a normal map is used (would be better/faster with MikkTSpace)
  • [x] Samplers
  • [x] Textures
  • [x] Animations
    • Paths
      • [x] Translation
      • [x] Rotation
      • [x] Scale
      • [x] Weights
    • Interpolation
      • [x] Step
      • [x] Linear
      • [x] CubicSpline
  • [x] Cameras
    • [ ] OrthographicCamera
    • [x] PerspectiveCamera
  • [x] Materials
  • [x] Skins
  • [x] Morph targets
  • [ ] KHR_animation_pointer
  • [ ] KHR_draco_mesh_compression
  • [x] KHR_lights_punctual (partial support - SpotLight not yet implemented)
  • [ ] KHR_materials_anisotropy
  • [ ] KHR_materials_clearcoat
  • [x] KHR_materials_dispersion
  • [x] KHR_materials_emissive_strength
  • [x] KHR_materials_ior
  • [ ] KHR_materials_iridescence
  • [ ] KHR_materials_sheen
  • [x] KHR_materials_specular
  • [x] KHR_materials_transmission
  • [x] KHR_materials_unlit
  • [x] KHR_materials_variants
  • [x] KHR_materials_volume
  • [ ] KHR_mesh_quantization
  • [ ] KHR_texture_basisu
  • [x] KHR_texture_transform
  • [ ] KHR_xmp_json_ld
  • [x] EXT_mesh_gpu_instancing
  • [ ] EXT_meshopt_compression
  • [x] EXT_texture_webp
const gltfLoader = new GLTFLoader()
const gltf = await gltfLoader.loadFromUrl('path/to/model.gltf')

// create a gltfScenesManager from the resulting 'gltf' object
// assuming 'renderer' is a valid camera renderer or curtains instance
const gltfScenesManager = new GLTFScenesManager({ renderer, gltf })
gltfScenesManager.addMeshes()

Constructors

Properties

renderer: CameraRenderer

The CameraRenderer used.

The gltf object used.

scenesManager: ScenesManager

The ScenesManager containing all the useful data.

Methods

  • Get an attribute type, bufferFormat and size from its accessor type.

    Parameters

    Returns { type: string; bufferFormat: GPUVertexFormat; size: number }

    • corresponding type, bufferFormat and size.
    • type: string

      Corresponding attribute type

    • bufferFormat: GPUVertexFormat

      Corresponding attribute bufferFormat

    • size: number

      Corresponding attribute size

  • Get a clean attribute name based on a glTF attribute name.

    Parameters

    • gltfAttributeName: string

      glTF attribute name.

    Returns string

    • Attribute name conform to our expectations.