FBX2glTF icon indicating copy to clipboard operation
FBX2glTF copied to clipboard

don't output floats as doubles

Open zellski opened this issue 5 years ago • 3 comments

Given that we store everything in RawModel as floats, we should not then output them as if they had meaningful double-precision data. We just end up with deceptive ugliness like

        "metallicFactor": 0.200000002980232,
        "roughnessFactor": 0.300000011920929

We should investigate explicitly serialising to JSON in single precision.

zellski avatar Apr 03 '19 19:04 zellski

Technically, JSON has only double-precision floats. So deserializing truncated values would yield different output unless loader also uses single-precision floats internally.

lexaknyazev avatar Apr 03 '19 20:04 lexaknyazev

I think the FBX SDK is largely concerned with doubles. I'm not sure why FBX2glTF truncates everything to single precision -- if there's any reason I should maintain that. I don't expect this tool to be run on tiny memory-strapped machines...

zellski avatar Apr 08 '19 05:04 zellski

I guess the question is whether to turn the whole FBX2glTF pipeline doubles-friendly -- which would be fine for 99% of use cases, but could cause memory issues for really gigantic models -- or, if we have to truncate at some point, it's more honest to output with only as much precision as we can still claim to have.

zellski avatar May 14 '19 14:05 zellski