A C++ project that implements a basic Minecraft-style voxel world using Modern OpenGL. This repository includes classes for chunks, blocks, camera, world generation, skybox, lighting (sun), and a simple UI element (crosshair).
It also features multi-threaded chunk loading, allowing chunk generation to occur asynchronously without blocking the main thread.
-
Voxel/Block System
- Blocks have different types: Grass, Water, Stone, etc.
- Chunk-based system for efficient rendering of large worlds.
- Simple tree generation within chunks.
-
Procedural World Generation
- Basic heightmap-based terrain generation for each chunk.
- Multi-threaded chunk loading using
std::async, so the chunk generation and mesh creation happen asynchronously while the main game loop continues.
-
Camera and Movement
- Free-fly camera with support for survival, creative, and spectator modes (expandable).
- Supports sprinting, collision checks, and vertical movement.
-
Lighting & Skybox
- A skybox rendering system providing a 360° environment background.
- A simple sun cube that moves over time, simulating daylight progression.
-
UI Components
- Crosshair rendering at the center of the screen.
-
Chunk Mesh Generation
- Each chunk is converted into a single mesh for efficient batch rendering.
- Neighboring chunk faces are accounted for to avoid rendering hidden block faces.
This project is plug-and-play — all necessary libraries have already been downloaded or included within the repository itself:
- GLFW — for window/context creation and input handling.
- GLAD — for loading OpenGL function pointers.
- GLM — math library for vectors and matrices.
- stb_image.h — for loading textures.
- A C++17-compatible compiler (MSVC, Clang, or GCC).
This project was created for study purposes. Contributions are welcome but not actively sought.
This project is licensed under the MIT License - see the LICENSE file for details.


