This is my first attempt at creating a voxel game in C++. I worked on it during the summer of 2018.
Description
After owning a Minecraft network for a few years, I wanted to create something similar from scratch. That's why I started writing this engine. Because I went in almost blind, it is a bit messy at times. It did however teach me a lot about voxel rendering. Rewriting this project on a proper foundation is still on my list of projects that I want to work on.
Rendering
The project uses OpenGL for all rendering. I use array textures and multiple index buffers to construct meshes in chunks of 32x32x32 blocks. By doing face culling, the visible faces are greatly reduced. Rebuilding the meshes whenever a block within a chunk changes is acceptable for performance. New techniques I have learned about such as greedy meshing and dynamic texture indexing in DX12 would greatly increase the performance.
Terrain Manipulation
The terrain in generated using Perlin noise. Blocks can be deleted and placed at run-time. This triggers dynamic mesh regeneration using a worker-thread pool. Once mesh regeneration is done, the new mesh is automatically loaded to the GPU and displayed.
Infinite World
Something I always wanted to have in Minecraft was infinitely deep worlds. That's why my worlds have no bounds in any direction. In the video on the left, you can see a hole I dug, as well as the terrain from below with all the culling in place.
Lessons Learned
This project was made when I was still not entirely familiar with OpenGL. It has taught me a lot about performance in graphics rendering, and I have now learned about many new algorithms and techniques that would greatly improve a project such as this. I still plan on making a proper voxel rendering framework in the future.