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.
I was curious to see if this was possible and it was, so I'll open this up for discussion.
The benefits would be that we get to delete a bunch of code that is usually painful to migrate, and maybe Bevy will implement batching for
Mesh2d
some day.The main hacky bit is that the
MaterialMesh2dBundle
needs a white color material for the vertex colors to work properly (bevy's default is fuchsia and the color is multiplied) and I'm currently just creating that every time remeshing happens. At the very least, that could be cleaned up so that it only happens on shape creation.But I'm hoping for something cleaner. That probably involves using our own material/shader, which should be a lot less involved than a full-on custom pipeline. I'll investigate that soon.
I'm also not sure if it's possible to get lyon to tesselate with the correct winding order, so I just reversed the indices.