From 42401e4e1c34f9ddc7246550227281ec6aeeceac Mon Sep 17 00:00:00 2001 From: Aaditya Dhruv Date: Sat, 31 Jan 2026 15:46:50 -0600 Subject: 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 --- src/chunk.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/chunk.h') 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. -- cgit