Make the compute mesh example easier to understand and modify.#25033
Open
ivanceras wants to merge 3 commits into
Open
Make the compute mesh example easier to understand and modify.#25033ivanceras wants to merge 3 commits into
ivanceras wants to merge 3 commits into
Conversation
…aking the vertex data assembled inside the loop
…g in the shader code
Contributor
|
Welcome, new contributor! Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
Solution
192which is the total number of f32 in the vertices data. Instead we use theVERTEX_COUNT(24 in this case) to assemble the vertex data elements inside the loop. The array of 8 element of f32 becomes an inner loop inside of the main loop, which makes a total of 192 iteration matching the original algorithm.normalsanduvsfrom the combined vertex data inverticesto make it more flexible to add or remove attributes in the vertex data of a mesh.Testing
compute_meshexample. It should be running the same as before.