-
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
Separate attribute format #819
Comments
First thoughts. These features are also present in OpenGL ES 3.1, so they could become available for WebGL someday. Right now each So, your idea is to set up all attributes for In theory, decoupling buffers and their data from attributes layout (i.e., binding them in |
Good ideas here, but I would push this post 2.0 to control the scope and since we're not 100% set on this direction. |
This would only be necessary if attributes are non-interleaved, right? So answer is: not necessarily.
They represent the number of vertices and number of indices.
This could be needed. I'm developing my own renderer and I'm using MDI for a .gltf model (for objects with 100 to a 1000 meshes). So offsets are calculated and stored in a command buffer. But I can understand that MDI is not an option for everyone. |
#827 is the first step in this direction. I don't think anything beyond that could fit into 2.0 scope. |
@onox feel free add your renderer to the list of glTF Tools by opening a pull request to edit this repo's CHANGES.md. |
Thank you for mentioning it. The glTF loader still needs lots of work, but when it gets into shape, I'll consider opening a PR. |
Is this issue still needed? |
Applications are able to go through all meshes and construct an optimal amount of attribute format descriptors for the used API. To standardize such functionality (if there's enough interest), a new extension would have to be designed. |
It seems that glTF's accessors more or less assumes using WebGL's
vertexAttribPointer()
. However, OpenGL 4.3 specifies the ARB_vertex_attrib_binding extension so that you just specify the format once and then switch the vertex and index buffers.Right now, every
primitives.attributes
could use (in theory) a different vertex format. That means a loader either has to (wrongly) assume each primitive uses the same vertex format or otherwise do additional processing to verify that just one format is being used.Wouldn't it be better to separate the attribute format? In WebGL this doesn't matter much; the values from the format can be combined with the (simplified) accessor when calling
vertexAttribPointer()
. But for OpenGL it could simplify things a bit. I don't know about Vulkan.Basically you get something like this: (I just completely removed the accessors, but maybe it's better to keep simplified accessors (due to min/max/count))
Any comments?
The text was updated successfully, but these errors were encountered: