-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Allow creating meshes without vertex positions #62046
Conversation
d34d12d
to
e0cf325
Compare
This looks good, but I fear users maaay make a mistake using the API and get no error because now this is valid? I was wondering if a format flag should be supplied (like |
2ac813b
to
06a47ea
Compare
@reduz Should be good to go now. It prints an error if drawing to create a mesh without a vertex buffer and without the |
needs rebase |
06a47ea
to
d98952a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor nitpicks, besides that this seems ready to go :)
…hes can now be constructed from an index buffer alone
d98952a
to
bbbcdd7
Compare
Thank you! |
While the `RenderingServer::mesh_create_surface_data_from_arrays` method does support vertexless meshes (see godotengine#62046 and godotengine#83446), it enforces that the size of custom arrays is dependent on the size of the vertex array. This effectively means that custom arrays cannot be used in vertexless meshes. This commit changes the way the array length is computed so that if no vertex array is provided, its length will be inferred from the custom arrays, if provided. It therefore adds support for custom arrays in vertexless meshes.
Implements the second half of: #19473
This allows meshes to be created without using vertex positions (for example, a mesh can be created with just an index array. In certain cases it can be much more efficient to only pass an index array and then pull your vertex information from a storage buffer or texture.