You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think accessors are specifically limited to single precision and it seems that some viewers, such as Babylon.js and Unity, have issues rendering transform hierarchies with double precision. As such I’m curious whether there is an expectation that these values be kept in single precision range?
The text was updated successfully, but these errors were encountered:
There has been some discussion about this, for example in #1574 .
The storage format for accessors is defined in the spec because this describes the actual binary representation.
In contrast to that, when referring to the JSON part: The tl;dr here is that whatever applies to JSON implicitly applies to glTF, because glTF cannot sensibly define a "subset of JSON". The JSON spec also remains a bit vague here, but strongly suggests that numbers from JSON are supposed to be handled at least as 64 bit floating point values. (There may be libraries that can handle more, or treat integer values differently, but 64 bit (aka double) should be a reasonable baseline to ensure interoperability).
That said: The glTF spec does not specify some of the details that you refer to when you mention 'rendering issues'. When you have an implementation (i.e. a rendering engine) that stores all its matrices with float, then you'll inevietably encounter problems when, for example, a node has a transform that contains values that cannot sensibly be represented as float. The general recommendation here would be ~"to use 64 bit wherever possible".
So to summarize that, roughly speaking:
The JSON input can contain double values
The rendering (on the level of WebGL) basically always happens with float values
The rendering engine should try to cope with that by converting the data to float "as late as possible", only directly before passing it to the GPU
(The last point might be elaborated by someone who can describe this more profoundly on a technical level...)
Does the specification indicate whether the node matrix and translation properties support double precision numbers?
https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/schema/node.schema.json
I think accessors are specifically limited to single precision and it seems that some viewers, such as Babylon.js and Unity, have issues rendering transform hierarchies with double precision. As such I’m curious whether there is an expectation that these values be kept in single precision range?
The text was updated successfully, but these errors were encountered: