pmndrs / gltfjsx

🎮 Turns GLTFs into JSX components
https://gltf.pmnd.rs
MIT License
4.7k stars 310 forks source link

Missing Extension #170

Closed maxb35t closed 1 year ago

maxb35t commented 1 year ago

Missing Extension EXT_meshopt_compression, confused as readme states meshopt support ootp and in GLTFLoader there is no meshopt decoder

drcmda commented 1 year ago

I think it’s because it uses an older loader. The loader isn’t compatible with node so I have hack it and remove all the web features, that freezes it in time. what the readme states is that drei/useGLTF handles draco and meshopt automatically.

CodyJasonBennett commented 1 year ago

Should this be upstreamed into three-stdlib? I remember recently making fixes so GLTFLoader would work in an SSR environment.

drcmda commented 1 year ago

Should this be upstreamed into three-stdlib? I remember recently making fixes so GLTFLoader would work in an SSR environment.

would be lovely if that were possible. currently it's a complete hack here, i removed everything that loads, fetches and processes links, binaries, textures. not having to haul that around would be a major relief!

drcmda commented 1 year ago

btw i just realise, the root issue is a gltf-transform thing. gltfjsx reads out meshopt compressed glbs fine, it disregards buffers completely anyway. but gltfjsx --transform uses gltf-transform and that currently throws:

~/Downloads/free_1972_datsun_240k_gt  main ✗                                                                                                     238d0h ⚑  
â–¶ node ~/dev/gltfjsx/cli.js datsun-transformed-v1.glb --transform
datsun-transformed-v1.glb --transform
Error: Missing required extension, "EXT_meshopt_compression".
    at Function.validate (/Users/ph/dev/gltfjsx/node_modules/@gltf-transform/core/dist/core.js:1:48913)
    at Function.read (/Users/ph/dev/gltfjsx/node_modules/@gltf-transform/core/dist/core.js:1:41340)
    at exports.NodeIO.readJSON (/Users/ph/dev/gltfjsx/node_modules/@gltf-transform/core/dist/core.js:1:49113)
    at /Users/ph/dev/gltfjsx/node_modules/@gltf-transform/core/dist/core.js:1:40960
    at async transform (file:///Users/ph/dev/gltfjsx/src/utils/transform.js:15:20)
    at async WriteStream.<anonymous> (file:///Users/ph/dev/gltfjsx/src/gltfjsx.js:44:11)
drcmda commented 1 year ago

alright, should be fixed ...

maxb35t commented 1 year ago

Im still getting the error should I be doing anything different?

maxb35t commented 1 year ago

Sorry please ignore managed to get it working, thank you for the fix