meshoptimizer
meshoptimizer copied to clipboard
gltfpack could generate invalid gltf when float numbers are invalid
I have a valid glb file, become invalid after being processed with gltfpack, because 'inf' is invalid json number:
"KHR_texture_transform": { "offset": [-2.60883001e+38, -39.7892303], "scale": [inf, inf] }
gltfpack generates valid gltf if I add -noq option, which apparently doesn't use KHR_texture_transform here
Please attach the file (before processing).
well, I'll see if I can make a simple sample to repro it. but the point of my report is not about the actual file, I think the tool should be defensive and avoid output invalid json data in whatever case.
Yes, I think it’s reasonable to sanitize inf/nan during output, but ideally they also should not be produced during processing; if that happens on a real scene and not an artificially constructed input, it would be nice to debug and adjust the logic responsible.