summaryrefslogtreecommitdiff
path: root/src/camera.c
Commit message (Collapse)AuthorAgeFilesLines
* Move window size to a external configuration fileHEADmasterAaditya Dhruv16 hours1-1/+2
|
* Rework chunk rendering to get a 100x performance boost!Aaditya Dhruv34 hours1-1/+1
| | | | | | | | | | | | | | | | | | | | - Switching to semi-chunk mesh rendering just 100x the framerate, it was running at around 100fps for 3 CHUNK_DISTANCE, and pushing it above would make it drop to 30. Now it runs at 9000 frames per second with CHUNK_DISTANCE of 8, probably can push it even more - What is bizarre is this is just from the reduction in draw calls, I still need to implement face culling for invisible blocks (simple) and frustrum culling (using AABB) or maybe octrees - Block is way way more simplifed, it's just metadata about a coordinate in the chunk block array - All rendering and mesh generation code is handled by chunks. There is a VAO, single VBO and EBO for each chunk. The data buffer is loaded into the GPU with a chunk_load, and it stays like that until it is loaded again. chunk_load is called if we move chunks, in engine_update. Here we unload existing chunks, then load the new ones
* Minor performance boost + better inputAaditya Dhruv40 hours1-1/+1
| | | | Draw triangles in correct counter clock order, back face wasn't correct
* Add mouse-based movement to cameraAaditya Dhruv4 days1-2/+31
| | | | Can use WASD + Mouse to fly around the scene
* Add camera handling and movementAaditya Dhruv4 days1-0/+44
Camera related movements have been moved to camera.c - it tracks the matrices as well so we don't have to call it in block_update The player class is empty right now, but the camera will be a child of the player, and the player a child of the engine