Real Minecraft

This Minecraft clone was made from scratch using modern C++20, Vulkan, GLSL, and SDL. The clone is built upon RealCore and my own Vulkan abstraction, which is named Real3D. The project handles some of the rendering aspects of Minecraft, including random terrain generation, transparency, sprites, and animated textures. Real3D is not a perfect abstraction, but I enjoyed working on it, and I am planning on improving it and learning more about Vulkan. For this project, it works quite well in my opinion. My interest in graphics programming skyrocketed while working on this project, and I have many more projects like this in mind.

View on Github
Picture of Real Minecraft

About Real Minecraft

Introduction

You've probably heard of it, Minecraft, it is an infinitely large sandbox game where the player can build everything they can think of. The terrain is made of cubes layed out by using a noise algorithm. The world consists of multiple chunks (meshes). Only a small amount of these chunks are rendered obviously, for performance reasons. On my laptop, my clone of the game ran smoothly (60FPS) up to a render distance of 12 (25 x 25 chunks). When traveling, new chunks are created, while old chunks, now out of the render distance, are deleted. Any progression on any save will be saved.

Real 3D

Real3D was built by following the Vulkan Tutorial. The version the Minecraft clone was built upon was created in the course of 12 weeks. The engine of course handles everything render related, and comes with some handy components, like a camera component and a mesh component. There is also an option to load meshes, textures and shaders. Materials with custom pipelines can also be created by the user and applied to any mesh. Frustum culling using AABB is also implemented in the engine for a better performance. Sadly I didn't find the time to fully include ImGui in the project yet, but this is on the top of my todo list.

Features

Some of RealMinecraft's features include transparency (water, leaves, flowers), animated textures (water), sprites (flowers), procedurally generated terrain using simplex noise, dynamic meshes and loading/saving of chunks.
Transparency was definitely the hardest to implement, I chose to sort the faces of the transparent meshes from furthest to closest to the player, but that came with its own flaws. I later learned about depth peeling, but I didn't have the time anymore to implement this. I am very interested in this subject and have done already some research, and would love to build a project around this. As mentioned, meshes in Real3D are dynamic, there can be vertices added and removed during rum time, so the player can place and destroy blocks wherever it wants.
Chunks are stored in a binary , I found it quit clever and fun to mess with this. Every chunk has one file, where its stores all the blocks that have been changed. The position and type of the block are all mashed in a couple of bytes for maximum efficiency.

Future Work

As mentioned before, improving and learning more about transparency in graphics programming is definitely a priority for me. I found it quit intriguing that such a simple thing as transparency that we don't even think about in real life, can be so difficult to add on to our screens. I also wanted to experiment more with shaders, as this project lacks a bit of those. Dynamic lighting is also something that I could experiment with.