[CLI] meshopt compression breaks UV coordinates
See original GitHub issueDescribe the bug UV coordinates seem to break in some cases when applying meshopt compression.
To Reproduce Steps to reproduce the behavior:
- Download the attached file MultipleUVRanges.zip
- Run
gltf-transform meshopt MultipleUVRanges.glb MultipleUVRanges.meshopt.glb
- Open the file e.g. in https://sandbox.babylonjs.com/ (doesn’t load in gltf.report)
- Note distorted UV coordinates on output file
Expected behavior Output file looks the same as input file
Versions:
- Version: 1.0.1
- Environment: nodejs
Notes
- doesn’t seem to happen when running
gltfpack -c
or-cc
on the same file
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Simplification, LOD and Multiresolution - CiteSeerX
These tutorial notes provide an introduction, review, and discussion of the state-of-the-art on simplification meth- ods, Level Of Detail, ...
Read more >Multiple UV Sets Getting Lost With Draco Compression
When compressing with Draco, any UV sets beyond the first two are lost. ... All of the texture coordinates of a Draco mesh...
Read more >loaders.gl - Yarn
loaders.gl. loaders.gl is a framework in the vis.gl framework suite that provides a collection of framework-independent loaders focused on geospatial, ...
Read more >meshoptimizer | meshoptimizer
If you want to use this library from Rust, you should use meshopt crate. ... For positions and texture coordinate data the two...
Read more >(PDF) Simplification, LOD and multiresolution: Principles and ...
Therefore, if we have a function ρ˜ : Ω ! Ω ˜ mapping each point in ... Among these are: the simplification of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(Talking about
MultipleUVRanges.glb
here.)The problem is obviously that the TEXCOORD_0 acccessor is using buffer view 5, which has the wrong filter (
OCTAHEDRAL
, so it should be for normals).Looking here
https://github.com/donmccurdy/glTF-Transform/blob/2b24c54e8c1631eda9f07c508ba15f413e81f45a/packages/extensions/src/ext-meshopt-compression/meshopt-compression.ts#L293
filter
always stringifies as"[object Object]"
, so effectively the filter is missing from the key. My guess is that’s why the buffer views are colliding. The TEXCOORDs on the other quads don’t collide because they differ in the byteStride as well as the filter (since they don’t get quantized I guess).Using
filter.filter
in the key fixes this case for me.Thanks @hybridherbst! Confirmed that model is fixed as well – and just published the fix as v1.2.2.