Skip to content

Tips needed for LineMaterial performance #8114

Closed Answered by nicopap
dimvoly asked this question in Q&A
Discussion options

You must be logged in to vote

It depends on your use case. Your code probably diverges a lot from the basic example you linked, so I have to make additional assumptions on how your code looks like to give any guess on why it slows down.

It sounds like you have a single entity per line. Bevy has poor performance with large entity count (especially if they are rendered). As you mentioned, it would be better to have a single mesh to update rather than a bunch of meshes. Consider having a single resource for lines, push lines to that resource, and a system that updates a mesh each frame based on that resource. this is how the future 0.11 bevy debug line feature will work. In this case, you don't have to manipulate shader …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dimvoly
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants