← Back to projects
C++ • OpenGL • Multithreading

Voxel Engine (MoiCraft)

A custom voxel engine written in C++ and OpenGL featuring procedurally generated terrain, chunk-based rendering, multithreaded generation, and rendering optimizations.

Procedurally generated terrain rendered in MoiCraft

Overview

MoiCraft is a voxel engine inspired by Minecraft that I built in C++ using OpenGL. The engine divides the world into chunks and generates terrain procedurally using Perlin noise.

I focused on the systems behind generating, meshing, and rendering voxel terrain efficiently, including multithreaded chunk generation and eliminating geometry that does not need to be rendered.

Technical Features

Procedural Terrain

Generated voxel terrain using Perlin noise to produce varying terrain heights across the world.

Chunk System

Divided the voxel world into chunks so terrain could be generated, meshed, and rendered in manageable regions.

Multithreaded Generation

Used a worker thread for chunk loading and mesh generation so expensive terrain work could run separately from the main rendering loop.

Mesh Optimization

Culled interior voxel faces during mesh generation to reduce unnecessary geometry sent through the rendering pipeline.

Rendering

Voxel chunks are converted into renderable meshes rather than drawing every block independently. Faces surrounded by adjacent blocks are omitted during mesh generation, reducing the amount of geometry required to render the terrain.

The project gave me experience working with OpenGL rendering, procedural geometry, CPU-side mesh generation, multithreading, and the performance considerations involved in rendering large voxel environments.