Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The glb model with skeleton animation, after being compressed with meshopt, has resulted in some parts being rendered smaller. #746

Closed
rarest opened this issue Aug 22, 2024 · 4 comments

Comments

@rarest
Copy link

rarest commented Aug 22, 2024

OriginModel:
origin.glb.zip
MeshoptModel:
meshopt.glb.zip

gltfpack options
./gltfpack -i origin.glb -o meshopt.glb -cc -kn -km -ke -kv -v

output message
input: 77 nodes, 3 meshes (3 primitives), 3 materials, 1 skins, 3 animations, 4 images input: 3 mesh primitives (22002 triangles, 14079 vertices); 3 draw calls (3 instances, 22002 triangles) output: 3 mesh primitives (22002 triangles, 14079 vertices); 3 draw calls (3 instances, 22002 triangles) output: 80 nodes, 3 meshes (3 primitives), 3 materials output: JSON 79643 bytes, buffers 299768 bytes output: buffers: vertex 104888 bytes, index 25183 bytes, skin 3374 bytes, time 507 bytes, keyframe 44089 bytes, instance 0 bytes, image 121710 bytes

use filament to preview the models:
image

@rarest rarest added the bug label Aug 22, 2024
@zeux
Copy link
Owner

zeux commented Aug 22, 2024

Duplicate of #433
Caused by excessive scale on Root node which is due to how Blender exports combined skinned/non-skinned models iirc
Can be fixed by passing -vpf

@zeux zeux closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2024
@rarest
Copy link
Author

rarest commented Aug 23, 2024

Duplicate of #433 Caused by excessive scale on Root node which is due to how Blender exports combined skinned/non-skinned models iirc Can be fixed by passing -vpf

It appears that using the -vpf option did not resolve the issue, the vpf model also looks like smaller. By the way, does the gltf 2.0 specification not support adding the scale attribute to the root node?
image

./gltfpack -i origin.glb -o meshopt_vpf.glb -cc -kn -km -ke -kv -vpf -v
meshopt_vpf.glb.zip

@zeux
Copy link
Owner

zeux commented Aug 27, 2024

I recommend using https://gltf-viewer.donmccurdy.com/ or https://sandbox.babylonjs.com/ for testing if the models are rendered the same way (although three.js has had some bounding box issues in the past so it's not always framed correctly). On vpf and original model both viewers result in the same view, so whatever logic Filament is using to frame the model must be misbehaving here. Unless you think that the actual scale here is somehow wrong but that seems implausible based on the results I see in Babylon.JS that, for both models, look like this:

image

Without -vpf it looks like this; again there's no scale issue here but there's a quantization issue that's the same as the issue I linked above.

image

@rarest
Copy link
Author

rarest commented Aug 28, 2024

Sorry for the late reply. I tested it with Three.js and Babylon.js, and the model scaling is indeed consistent. It’s likely that there is an issue with filament's handling of scale. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants