-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Stride forces non-vertex attribute accessors to each have their own buffer view? #1537
Comments
I'm inclined to say that (2) might be a mistake. In particular...
... seems to imply that vertex attributes cannot share a bufferView unless they are interleaved. I'm aware of no such requirement, and pretty sure our sample models would break that rule. If so, then (1) isn't an issue, correct? |
@scurest
Vertex attributes can be non-interleaved and still use the same bufferView because accessors have their own byte offsets. |
Yes, but I don't see a requirement that accessors within the same bufferView must all have the same element sizes. In that case, this spec language...
... implies that because the byteStride must be defined on the shared bufferView, it must also apply to all accessors pointing to that bufferView. On the other hand, if we consider (2) a mistake, omission of byteStride means that each accessor within the bufferView individually has a byte stride equal to the size of its elements. |
Only accessors of the same "real" stride can share a buffer view. This is a part of design of all modern APIs (including OpenGL with ARB_vertex_attrib_binding extension) - see illustrations in this comment. |
Ok, I see. The validator checks for Aside: We split bufferViews in three.js unless they are interleaved — it would be difficult to keep the attribute groupings intact within our own internal geometry representation, I think. |
I don't think I follow this. Could you please provide an example layout? |
Never mind, I think it's unrelated to the question here anyway. Going back to @scurest's points, I can see where (3) seems unnecessary. If samples like AnimatedTriangle already disobey this, loosening the requirement for non-vertex-attribute data might be possible. Curious to hear what others think. |
Here is what the spec says about stride
In addition, before #1501 the first quote read (note the more explicit last sentence)
From this conclude
I was originally going to file an issue against the validator (cc @lexaknyazev) because (1) is not flagged (example) and (2) is only flagged when the two accessors are vertex attribute data.
But I'm wondering if this is a spec issue instead with (2) instead, because
So assuming (2) is false, I think the spec should be updated to say something like
Also, what is the reason for (1)? I was thinking of using the stride for animation keyframes (by reusing the same buffer of keyframes just with buffer views with different strides to animate on ones, one twos, on fours, etc.).
The text was updated successfully, but these errors were encountered: