Skip to content

Mini Minecraft

A mini version of Minecraft built from scratch with C++, OpenGL, and Qt. This was made in collaboration with Estelle Kim and Jesse Zong. View the code

Mini Minecraft

Terrain

The terrain was based off using generic Perlin Noise as a heightmap. That was combined with a larger-scale voronoi noise texture to create sections that would turn into biomes, namely mountains, grasslands, and desert. The height between biomes is linearly interpolated based on the biome noise, and transitions into each biomes respective height range(for example, mountains have a larger height range than the desert). Object scattering was done through a voronoi-style point selection method, with trees for the snow and grass biomes and cacti for the desert. Rivers were created with a combination of L-systems and a voronoi distance function.

Mini Minecraft

Caves were also created with weighted 3D perlin noise.

Mini Minecraft

The terrain loads through a chunking system, where each chunk is 16x16 blocks. Terrain generation is multithreaded and runs asynchronous to the main application.

Shadowmapping

Our minecraft has shadowmapping for our single sun light source. We compute shadows by rendering our scene from the light’s view(orthographic), creating a “shadow map” for all the areas in our loaded terrain that should be lit. We then do a depth check in our fragment shader to see if the depth of our fragment equals its depth from the light view. If it does, we render it lit. Otherwise, we render it as a shadow.

Mini Minecraft

Procedural Sky

Our procedural sky is a simple gradient sky with a horizon blend. It has a dynamic day and night cycle, with a moving sun and stars. Furthermore, we generate procedural clouds through atmospheric scattering.

Mini Minecraft Mini Minecraft
Mini Minecraft

Water and Lava Post Processing

Procedural water and lava post processing overlays

Mini Minecraft Mini Minecraft

Additionally, we use separate, more reflective shading models for the water surface

Mini Minecraft

Code

This project was made for a class at the University of Pennsylvania, and as a result, the codebase cannot be shared publicly. If you are an employer interested in seeing the codebase, please contact me at saahil@seas.upenn.edu