DigNet
A Voxel Engine In Unity
DigNet is a voxel game made in Unity. Its look and design is intended to match the nostalgia I have
for early versions of Minecraft.
The project was started in late May 2024 and I decided to put it on my "will finish eventually, maybe,
probably, we'll see" shelf in mid July.
I knew most of the basic concepts for how a voxel engine can be created and optimized, but decided to follow a short youtube series as a foundation anyway. As I progressed, I took my own liberties to structure the code and project in a way I found to be more understandable.
I knew most of the basic concepts for how a voxel engine can be created and optimized, but decided to follow a short youtube series as a foundation anyway. As I progressed, I took my own liberties to structure the code and project in a way I found to be more understandable.
The first steps involved defining the data of the voxels and implementing an algorithm to represent them as a visual. There are a few limitations to consider. These limitations have determined the most common approach to this problem and the approach that games like Minecraft implement.
- Modern GPUs use triangulated meshes to render 3D objects
- The number of triangles defined on a mesh has a limit
- Triangles that will not be seen are wasted in the mesh
- The entirety of a mesh must be updated on the GPU if it changes
These limits lead to a concept commonly known as "chunks." The voxel world is split into sections of a constant voxel size. Each chunk has it's own voxel data and a related mesh. When a voxel is changed in a chunk, the mesh change required to represent it can be reduced to the chunk and it's neighboors. Chunks also allow for the loading and unloading of sections as the player moves through the world.
The textures were created from real photos cropped and downscaled in a way that tiled well. Any tiling seams were blended using the clone stamp tool.