diff options
| author | Aaditya Dhruv <[email protected]> | 2026-01-31 15:46:50 -0600 |
|---|---|---|
| committer | Aaditya Dhruv <[email protected]> | 2026-01-31 15:46:50 -0600 |
| commit | 42401e4e1c34f9ddc7246550227281ec6aeeceac (patch) | |
| tree | f9dc68a455f05257b1138702fb51d3ef6344ac03 /src/chunk.h | |
| parent | 7f13b0abaa76a5e90674d5733f8162f02ceab693 (diff) | |
Add face culling - drastic reduction in rendered faces
- Only render faces that are "visible" so - exposed to air essentially.
- We also check a neighbor chunk to test if there is a block, and
accordigly draw a face in the curr chunk
Diffstat (limited to 'src/chunk.h')
| -rw-r--r-- | src/chunk.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/chunk.h b/src/chunk.h index 12fa111..c22fd36 100644 --- a/src/chunk.h +++ b/src/chunk.h @@ -50,10 +50,11 @@ int chunk_gen(struct world* wld, vec2 coord, struct chunk** chunk); * used to translate the blocks that constitute the chunk * * The chunk will allocate a VAO/VBO/EBO buffer to render the chunk mesh. This GPU data is usually not updated in the loop, unless a chunk_update is called + * @param The world where this chunk belongs. It is a useful object to have, especially for face culling * @param chunk Chunk to load * @param coord coordinates in world space */ -void chunk_load(struct chunk* chunk, int coord[2]); +void chunk_load(struct world* world, struct chunk* chunk, int coord[2]); /** * Chunk updates are performed on already loaded chunks. It will redraw the * chunk mesh as needed based on block updates and whatnot. |
