-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpretation of bytestride parameters #34
Comments
I think you're just looking at the wrong part of the spec. From the byte stride definition:
"Between" attributes suggests to me that it does not include the size of the component, implying that a byteStride of 0 would also indicate densely-packed data, but the spec authors prefer to omit the value entirely in this case. The current algorithm has worked on all the sample models we've tried, but I admit it's possible that we misinterpreted. I don't think any of them use interleaved attributes or anything with byteStride. I'll ask the spec group. |
I just think it is ambiguous, if you read this statement:
Then it implies the stride is the total stride, not the padding. |
Wrong button. This statement implies that the stride is the total stride, not the padding
|
Well, it looks like you're right, though it took some digging. The byteStride definition references WebGL's
That's unambiguous. I'll get this fixed soon. |
Fixed in 019b1c6 |
I believe there may be a mistake in how bytestride is interpreted inside Accessors. The reference:
https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#floating-point-data
implies (it doesn't appear to be explicit) that the bytestride is the total stride between values, not the unused bytes.
In Accesor.cs:
https://github.com/AltspaceVR/UnityGLTF/blob/master/Assets/GLTF/Scripts/Schema/Accessor.cs
It appears that if ByteStride is set, then it is added onto a calculation of the component width. (E.G. line 312).
Most densely packed objects don't set byteStride, but collada2gltf does, see attached object. In this case the bytestride is only indicating that the data is tightly packed.
test2.zip
Anthony
The text was updated successfully, but these errors were encountered: