Some text nodes are not visible after using draco compression
TiagoCastilhos opened this issue · 2 comments
Describe the bug
Some texts are disappearing from the object after using draco to compress them. Here's an image comparing the original glb file (left) and the compressed glb file (right):
I've used babylon's sandbox to compare materials and nodes. The node that's representing this text is "oven_prof30sextmain_text007", and it's visible if I use the "Render wireframe over mesh" debug option. The material applied to this node is the same as the original, the only difference I could identify is the number of vertices.
To Reproduce
Steps to reproduce the behavior:
- Download the zip file with the original and compressed glbs
- Open those files in a GLB inspector
- See the difference between the original and compressed objects
Expected behavior
Objects should look the same
Versions:
- Version: 3.10.0, 4.0.0-alpha.5
- Environment: Node.js 20.7.0
Additional context
There are more objects with this same issue, let me know if they're needed to investigate.
Hi @TiagoCastilhos! Draco (and many other compression methods) use a quantization grid as part of the compression process. Practically that means each vertex is snapped to an NxNxN grid, where N is 2^bits for some bit depth.
By default in glTF Transform that grid is per-mesh, so either of two things will avoid the issue:
- Divide the text into smaller meshes, particularly separating the left and right dials
- Use a higher precision grid
The second option is easier and seems to work well here:
gltf-transform draco original_oven.glb draco_compressed_oven_p16.glb --quantize-position 16
@donmccurdy Thanks for the reply, I've just tested and it seems fine. Thank you so much!