summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Move window size to a external configuration fileHEADmasterAaditya Dhruv13 hours3-2/+6
|
* Bugfixes, infinite loading worksAaditya Dhruv16 hours6-31/+60
|
* Fix OpenGL vs local axis issueAaditya Dhruv17 hours2-22/+23
| | | | | | | | | | | | | | | | | | | | | - World coordinates is positive x to the left, positive y inwards, positive z upwards All math before sending data to OpenGL happens in these world coordinates. For example, curr_chunk is in world coordinates. chunk coordinates are also in world system. Only when we get/set data to OpenGL functions do we perform the 2 step translation - world y is negated and - then flipped with world z so { x, y, z } --> { x, z, -y } basically. These translations are done for example when in the chunk->model translation, converting camera coordinates (that are in opengl coords) to world coords for curr_chunk data, and setting vertex positions in chunk_load. These have been marked with "//OpenGL FLIP" so it's easy to find
* Add face culling - drastic reduction in rendered facesAaditya Dhruv19 hours4-44/+175
| | | | | | - 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
* Rework chunk rendering to get a 100x performance boost!Aaditya Dhruv31 hours9-292/+314
| | | | | | | | | | | | | | | | | | | | - 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 Dhruv38 hours5-23/+24
| | | | Draw triangles in correct counter clock order, back face wasn't correct
* Add basic block texturesAaditya Dhruv39 hours12-48/+147
| | | | | | | | | - Remove the code that sent colors through uniform variables, instead send texture data - Each vertex now has a texture coordinate - struct texture is a easy way to represent textures, can be extended later - Shaders updated to use textures
* Add freetype for font rendering, display fps in stderrAaditya Dhruv41 hours2-3/+34
|
* rename engine_draw to engine_startAaditya Dhruv45 hours3-4/+4
|
* Add chunk_unloading on chunk ChangesAaditya Dhruv2 days5-13/+61
| | | | | If we change a chunk, unload all chunks. This removes block GPU data (vbo, ebo, vao). We anyways redraw so we don't lose anything
* Update chunk rendering, improve chunk loadingAaditya Dhruv2 days8-58/+176
| | | | | | | | | | - On world_init, LOAD_CHUNK amount of chunks are preloaded - Chunks are loaded around the player's current chunk, in a square shape. The size of the shape is controlled by CHUNK_DISTANCE - Allow chunks struct to be independent of a position. We load a chunk TO a position in the world chunk grid (x, y). This allows us to "wrap" chunks, so we have an endless world, but we are really just wrapping around
* Add basic directional lightAaditya Dhruv4 days3-11/+67
|
* Move chunk to be 0,0 alignedAaditya Dhruv4 days2-3/+2
|
* Add mouse-based movement to cameraAaditya Dhruv4 days3-11/+57
| | | | Can use WASD + Mouse to fly around the scene
* Add camera handling and movementAaditya Dhruv4 days11-21/+112
| | | | | | | | 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
* Move input to separate fileAaditya Dhruv4 days5-7/+35
| | | | | - Input is handled in a separate thread, its all kind of unsafe right now but will fix later on
* Add World and multi-chunk renderingAaditya Dhruv4 days7-21/+87
| | | | | | | - More than 1 chunk can now be rendered with the help of the world struct - Block coords are now in world space, not local space - Engine init code cleaned up for cleaner world/chunk handling
* Add support for chunk and worldAaditya Dhruv5 days5-12/+157
| | | | | | | - Chunk is a array of blocks - World is a array of chunks - Basic chunk plains generation based on simple linear functions - Bunch of functions still not implemented, in design phase
* seed on timeAaditya Dhruv5 days1-0/+2
|
* Improve Block featuresAaditya Dhruv5 days2-14/+33
| | | | | - Rotate block scene at the center - Add block_debug to print block data
* Update local world coords for blockAaditya Dhruv6 days1-8/+9
|
* Fix block_init/draw bug, add more blocks to drawAaditya Dhruv6 days3-15/+26
| | | | | - VAO/VBO binding bug fixed, added explaination in comments - Add 9 rotating blocks
* Better rotating cubeAaditya Dhruv7 days4-43/+42
|
* rotating cubeAaditya Dhruv7 days9-62/+209
|
* wipAaditya Dhruv7 days10-119/+269
|
* initAaditya Dhruv2026-01-154-0/+2533