question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CLI] meshopt compression breaks UV coordinates

See original GitHub issue

Describe the bug UV coordinates seem to break in some cases when applying meshopt compression.

To Reproduce Steps to reproduce the behavior:

  1. Download the attached file MultipleUVRanges.zip
  2. Run gltf-transform meshopt MultipleUVRanges.glb MultipleUVRanges.meshopt.glb
  3. Open the file e.g. in https://sandbox.babylonjs.com/ (doesn’t load in gltf.report)
  4. Note distorted UV coordinates on output file WRYJMRK14U

Expected behavior Output file looks the same as input file chrome_ZiTdOLGFe9

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:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
scurestcommented, Nov 28, 2021

(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.

1reaction
donmccurdycommented, Dec 3, 2021

Thanks @hybridherbst! Confirmed that model is fixed as well – and just published the fix as v1.2.2.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found