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

gltfpack: Visible quantization artifacts on some scenes #466

Closed
Mateo150 opened this issue Aug 18, 2022 · 7 comments
Closed

gltfpack: Visible quantization artifacts on some scenes #466

Mateo150 opened this issue Aug 18, 2022 · 7 comments

Comments

@Mateo150
Copy link

Mateo150 commented Aug 18, 2022

I recently update to the latest version, v.0.18.
And realiced that now is very common after a simple optimization, even without compression the geometry looks "pixelated"
gltfpack -i ... -o ...

How it should look.
image

How it actually look.
image

I think this was due to some issue on my meshes, but after the update this happen almost every time.
with v.0.16 this neeeeever happen

Any idea why this is happening?

@Mateo150 Mateo150 added the bug label Aug 18, 2022
@zeux
Copy link
Owner

zeux commented Aug 18, 2022

This looks as if something changed with quantization behavior between 0.16 and 0.18. Please attach the reproduction scene - without it it's impossible to diagnose cases like this. You can also pass -vp 16 to improve this behavior.

@zeux
Copy link
Owner

zeux commented Aug 18, 2022

P.S. It's actually a little surprising that this scene used to work without quantization artifacts without extra options. You might want to use -kn flag because without it gltfpack will try to transform meshes to world space if they are static.

@zeux zeux changed the title Geometry ruined :( gltfpack: Visible quantization artifacts on a large scene Aug 18, 2022
@zeux zeux added the gltfpack label Aug 18, 2022
@Mateo150
Copy link
Author

Mateo150 commented Aug 18, 2022

Thanks for answering!

  1. Not necesary only on larger scenes. This is another one, very simple, in this case the character is rigged.
    image
    A thing is that I realized, it only happens in certain meshes with the property in common than the vertex are very close one of each other. (This could be a factor?)

  2. -vp 16 makes it looks better but still have trace of those squares. In v0.16 with default value works perfectly.

  3. Yeah sure, in this scene I need to use -kn specialy and other flags, I mention that no extra options to make it clear that even in the simplest way happen that "squarization".

  4. https://we.tl/t-pvsdQ4kGkH
    Here is this character scene without quantization, as blender exports it. And this is how I quantize it and outputs as the previous image gltfpack -c -i ./Ar_v4.glb -o ./Ar_v4c.glb

@zeux zeux changed the title gltfpack: Visible quantization artifacts on a large scene gltfpack: Visible quantization artifacts on some scenes Aug 18, 2022
@zeux
Copy link
Owner

zeux commented Aug 18, 2022

The scene above has the same issue on gltfpack 0.16 as far as I can tell. This came up before (#433) and is due to some odd export behavior that Blender has with skinned meshes and unit conversions, where it exports skinned geometry at a very different resolution vs non-skinned geometry.

I am not sure if this is fixable, would need to think about the consequences of propagating scale from the skinned model into the vertex data. Recently added -vpf fixes it but it's not very widely tested.

@zeux
Copy link
Owner

zeux commented Aug 20, 2022

Note: for any report in this thread that doesn't come with a link to the scene before the compression, it's going to be impossible to investigate whether it's something that can be improved or not. So far out of 3 examples here only one (from comment #466 (comment)) has been reproduced and traced to a skinning export issue, tracked in #433.

@scarletsky
Copy link

Hi, I just have a test on a model on sketchfab
https://sketchfab.com/3d-models/fictional-supercar-v12-goblin-0a20e49ad5774d778567cb5c3f345786

I do these steps with the model:

The result is OK, and I modify the model, add a really large sphere on the model. This time, I got artifacts on gltfpack -cc, and got better result with -vp 16

OK model.glb.zip

OK model_meshopt.glb.zip

OK model_with_sphere.glb.zip
image

Artifacts model_with_sphere_meshopt.glb.zip
image

Little artifacts model_with_sphere_meshopt_vp16.glb.zip
image

@zeux
Copy link
Owner

zeux commented Oct 4, 2022

Since no new examples have been posted, and #466 (comment) is inevitable / expected, I'm going to assume that there's no regression and that the only tangible issue is with the skinned models and a very large scaling factor that Blender adds, which will be tracked / fixed by #433.

@zeux zeux closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2022
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

3 participants