zeux / meshoptimizer

Mesh optimization library that makes meshes smaller and faster to render
MIT License
5.57k stars 479 forks source link

gltfpack: Objects with large scales distort other objects' geometry #645

Closed enesaltinkaya closed 9 months ago

enesaltinkaya commented 9 months ago

Hi, i want to first say thanks so much for this awesome project. When I place a simple plane and scale it 100 or 1000 other objects in the scene lose detail. I made a quick video showing the issue.

I have this script, exports .blend file to .glb, then runs gltfpack on it. I also tried loading the same file on https://sandbox.babylonjs.com/ and https://gltf-viewer.donmccurdy.com/, they showed the same result.

https://github.com/zeux/meshoptimizer/assets/8594559/9c381828-a5d2-4204-ae31-acc8b402dce3

zeux commented 9 months ago

Yeah this is a known issue with large scales; tracked in #433. You can use -vpf command line option as a workaround for now, or -kn will also often fix the issue.

enesaltinkaya commented 9 months ago

MainMenu.blend.zip .blend and .glb files are in the zip file.

I noticed -kn paremeter helps if I don't apply the scale in blender.

Thanks!

zeux commented 9 months ago

Looking closer at this report and I think it's the exact same cause as #433; I'm going to close this as a duplicate, the actual fix will come as part of #433. -vpf can be used as a workaround in the meantime.