Skip to content
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

Reduce vertexbuffer allocations #89

Closed
kennyvv opened this issue Aug 31, 2021 · 2 comments
Closed

Reduce vertexbuffer allocations #89

kennyvv opened this issue Aug 31, 2021 · 2 comments

Comments

@kennyvv
Copy link
Member

kennyvv commented Aug 31, 2021

Currently we have a lot of vertexbuffers for all sorts of different things. This causes a lot of lag when spawning or loading & updating chunks. All of these operations need to be executed on the UI/Rendering thread. To fight this we should reduce the amount of allocations & updates.

For example:

  • Chunks have multiple vertexbuffers, 1 for each renderstage required. (Renderstages seperate different block types like translucent, animated or solid blocks)
  • For each entity a new vertexbuffer is created for it's model, model instancing should be used to reduce this as lots of entities share the same basic model.
@kennyvv
Copy link
Member Author

kennyvv commented Sep 4, 2021

We could also start using indexbuffers for chunks again, this way when a block is removed from a chunk all we have to do is remove the indexes to that block's data from the indexbuffer instead of rebuilding the whole vertexbuffer.

@kennyvv
Copy link
Member Author

kennyvv commented Dec 21, 2021

Closing this issue, a better more detailed version is available in issue #106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant