A Case study
HexaCraft
A voxel sandbox written from scratch in C++17 and OpenGL 3.3, in which every block is a hexagonal prism instead of a cube.

Why hexagons
Every block is a hexagonal prism on an offset grid. Each block has six neighbours instead of four, so terrain steps and biome edges curve instead of forming staircases, and water pools into hexagonal outlines. At eye level it reads as ordinary voxel terrain. The tiling shows from above or along a cliff edge.

World
- A 200 × 200 × 32 grid generated at startup from layered value noise.
- Five biomes (sand, grass, stone, water and snow) with blended edges, plus prebuilt structures such as a castle, a village and a pyramid.
- Trees are grown by a recursive fractal routine, then baked into one vertex buffer per variant, so a forest costs one draw call per variant instead of a fractal walk every frame.

Rendering
- Phong (per-fragment) and Gouraud (per-vertex) shading, switchable at runtime.
- A directional sun and moon, point lights and a spot light, each toggled independently, as are the ambient, diffuse and specular terms.
- Nearest-N light selection, so torches and fireplaces light their surroundings without exceeding the shader’s uniform budget.
- Frustum and occlusion culling, 4× MSAA, a seamless skybox, distance fog, and a deferred pass for transparent water.



Gameplay
- Walk, sprint, jump and fly, with health, stamina and hunger.
- Break and place blocks, and sculpt terrain.
- A 36-slot inventory with a 3 × 3 crafting grid and a searchable recipe book.
- Chickens, pigs, sheep, zombies and skeletons, each with idle, wander, chase, attack and flee states.
- A drivable car with suspension that follows the terrain.
Stack
C++17, OpenGL 3.3 core profile, hand-written GLSL, GLFW, GLAD, GLM and stb_image.