gpu-curtains
    Preparing search index...

    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
      • [x] OrthographicCamera
      • [x] PerspectiveCamera
    • [x] Materials
    • [x] Skins
    • [x] Morph targets
    • [x] KHR_animation_pointer (using GLTFPointerAnimationsManager extra class)
    • [ ] KHR_draco_mesh_compression
    • [x] KHR_lights_punctual
    • [x] KHR_materials_anisotropy
    • [x] KHR_materials_clearcoat
    • [x] KHR_materials_diffuse_transmission
    • [x] KHR_materials_dispersion
    • [x] KHR_materials_emissive_strength
    • [x] KHR_materials_ior
    • [x] KHR_materials_iridescence
    • [x] KHR_materials_sheen
    • [x] KHR_materials_specular
    • [x] KHR_materials_transmission
    • [x] KHR_materials_unlit
    • [x] KHR_materials_variants
    • [x] KHR_materials_volume
    • [x] KHR_mesh_quantization
    • [x] KHR_node_visibility
    • [ ] 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()
    Index

    Constructors

    Properties

    renderer: CameraRenderer

    The CameraRenderer used.

    The gltf object used.

    scenesManager: ScenesManager

    The ScenesManager containing all the useful data.

    pointerAnimationsManager: GLTFPointerAnimationsManager

    Optional GLTFPointerAnimationsManager used to handle pointer animations, if any.

    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.