Skip to content

Error reading glb file #366

Answered by donmccurdy
freyatech asked this question in Q&A
Sep 28, 2021 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

DT_FLOAT32 is a Draco constant, it sounds like the file you're trying to load might require Draco decompression? If so, you'd need to use the draco3dgltf npm package and register it as shown here:

https://gltf-transform.donmccurdy.com/classes/extensions.dracomeshcompression.html#example

import { NodeIO } from '@gltf-transform/core';
import { KHRONOS_EXTENSIONS } from '@gltf-transform/extensions';
import draco3d from 'draco3dgltf';

// ...

const io = new NodeIO()
    .registerExtensions(KHRONOS_EXTENSIONS)
    .registerDependencies({
        'draco3d.decoder': await draco3d.createDecoderModule(), // Optional.
        'draco3d.encoder': await draco3d.createEncoderModule(), // Optional.
    })

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by donmccurdy
Comment options

You must be logged in to vote
1 reply
@donmccurdy
Comment options

Comment options

You must be logged in to vote
1 reply
@donmccurdy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants