Refactor Meshing/Rendering communication #13
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "multithread-refactor"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
The refactor decouples the updating thread and the rendering thread.
The latter should not use any information about the chunk itself, only about the mesh. Previously, some information about the mesh needed for rendering was stored in the chunk itself (VAO, buffers, number of vertices). Synchronization between the meshing and the rendering thread is needed because communication with the OpenGL context can only happen in the main (rendering) thread
With this new system:
This also avoids storing mesh data inside the chunk, which now effectively only holds data about the world
Also refactor the file structure for more organization and to keep things where they belong (e.g. ChunkMeshData should be initialized in chunkmesher, not in chunkmanager)