Closed butaixianran closed 2 years ago
AFAIK FBX stores shapekey positions sparsely (#1346) and doesn't store normals.
Thanks for your reply, it helps.
Now, I unchecked shape key normal when exporting, bin file is down to 31mb.
Then, we have to wait Sparse Accessors for gltf.
Would it be possible to share the .blend
and/or .glb
files for this example?
If your game engine supports the EXT_meshopt_compression
glTF extension I'd suggest trying to run gltfpack on the model:
gltfpack -i in.glb -o out.glb -cc
I updated a blender file also a glb file for testing:
blender file: 108mb https://mega.nz/file/9n5W3R7I#isbVWh_xI_vnU5JpIppL9f99tOfSkFT8nW5NcrXDgA0
glb file: 75mb https://mega.nz/file/Rjw2nTKA#boURdDt2AE6DFFFpl3vi8JDks__FuG5JdgMJoU7oknk
There is a Daz Genesis 8 free default character in it, with facial shape keys.
Also thanks for the information about gltfpack. It helps to size down glb from 50mb to 35mb.
But I can't find any information about which gltf importer support "EXT_meshopt_compression" in Unity. Most gltf importer have not been updated for years.
Thanks! glTFast for Unity is the package I'd suggest, and does support EXT_meshopt_compression. I'll look into ways to reduce the file with sparse shape keys as a post-export optimization when I have the chance, or the gltfpack author might be open to implementing that as well.
Closing, as there is no bug here. Only space for enhancement, in case one day we manage sparse encoding. This is not a priority for now
As an update here — glTF Transform v3 will support writing sparse (mostly zero) data more compactly, and could be a good option for compressing files with shape keys, like this one.
Example, using a pre-release of v3:
npm install --global @gltf-transform/cli@next
gltf-transform sparse input.glb output.glb
I didn't find the original FBX to compare, but this seems to bring the size down to where you'd expect. The .bin file containing the mesh data is now only 4.4 MB.
Hi @donmccurdy do you know how can I use gltf-transform with threejs
@mostafamdy let's discuss this in https://github.com/donmccurdy/glTF-Transform/issues/882.
Am I correct in assuming this is a duplicate of:
I'll put my comment there instead.
I'm exporting Daz Character from Blender to gltf+bin files. Character is with 50 common facial and viseme morphs, without cloth, hair or animation.
File size of gltf is 2mb, but bin file goes to about 70mb.
If I export fbx from Daz or Blender with morphs, fbx file size is about 6mb.
That's a big difference between 6mb and 70mb.
And if I export gltf+bin file without shape keys, bin file is less than 6mb.
This could make gltf out of game when exporting model from blender to game engines.
Is there a solution for this?
Infromation: Blender version: 3.0
Daz to Blender bridge for 3.0: https://github.com/butaixianran/DazToBlender