Decode 3D texture coordinates during upgrade #146
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is structurally similar to #98 (where "structurally similar" means "largely copy and paste"), with a similar summary:
SHORT
The exact encoding of the texture coordinates is not yet clear. It just seems to be "one (arbitrary) way" of not storing the
VEC2/FLOAT
(2 * 4 = 8 bytes), but instead, storingVEC3/SHORT
(3 * 2 = 6 bytes).In one of the relevant glTF files, the decoding in the shader was done like this:
This was for an accessor with VEC3/SHORT.
This PR implements the decoding of VEC3/SHORT (or VEC3/BYTE) texture coordinates into VEC2/FLOAT texture coordinates. From a quick test with one of these B3DM files that contain such glTF 1.0 data, the result can be rendered in CesiumJS.
But... there are some guesses and degrees of freedom.
UNSIGNED_SHORT
components?Some of this still has to be sorted out and confirmed, so I'll just open this a a DRAFT for now.
(NOTE: The state in this PR currently tries to ignore missing
BATCHID
attributes in B3DM files. This should not be necessary. In the final state, this might be omitted. But there are reasons to assume that this is one quirk that may happen for ~"some old legacy data sets" - details TBD)