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

Improve batched renderer #34

Open
abc013 opened this issue Nov 10, 2020 · 1 comment
Open

Improve batched renderer #34

abc013 opened this issue Nov 10, 2020 · 1 comment

Comments

@abc013
Copy link
Owner

abc013 commented Nov 10, 2020

  • Motivation: The current renderer model does not only hold both raw and calculated vertices in memory, but also a matrix. The CPU is used to make calculations with the modelMatrix, which should be done on the GPU. This leads to
    1. more GC calls
    2. more CPU usage
  • Proposed solution: Store raw vertex data on the GPU in batches. Renderable structures only save buffer ID, offset and length of data as well as the matrix. Once called to render, the matrix is pushed into the GPU and the batch renderer renders the vertices with the specified offset. This saves a) the memory/GC problem b) the matrix calculation provlem
  • Disadvantages: This basically makes batched renderers unnecessary. Also, it is not quite sure what happens once certain vertices are not needed. However, one has to be reminded that every vertex buffer basically is used by the game, as data structures are static and do not change often.
@abc013 abc013 added this to the Performance milestone Nov 10, 2020
@abc013
Copy link
Owner Author

abc013 commented Nov 10, 2020

Solution to this possibly also fixes #24.

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