meshoptimizer
meshoptimizer copied to clipboard
gltfpack: Improve handling of meshes with very large UV bounds
gltfpack version: 0.14 and 0.15
I convert my gltf model to gltfpack format by -tc, it will generate a new model correct. And then use KTX2Loader and GltfLoader to load the target model in Threejs(v0.122.0).
But some textures are displayed as stretch(LEFT: before convert, RIGHT: after convert), I don't know what's the reason for this result? what should I do to resolve it?

Please attach a model that would allow me to reproduce this.
test07.zip I put the model into the zip file in attachment, thank you
I looked into why this happens; this is due to some of the textures being mapped on geometry with very large UV range, e.g. one of the walls has a texture stretched because the ground mesh has some geometry that is mapped to the same texture with UV range min -376010.687500 0.709212 max 376014.500000 0.921277.
For now I'd recommend using -noq for this mesh. There are some changes planned to gltfpack that can improve the behavior for cases like these, so I'm relabeling this as "enhancement".
OK, thank you
I have had similar issue that models from different sources had very different UV scale/vertex scale, affecting the quantization. I had to change source models to be in a similar range to fix this. I think if meshoptimizer could handle this in itself (e.g. by normalizing outlying values to the 90-percentile scale), this could be a non-issue.