A lightweight, modular 2D/3D voxel game engine built with C++20 and OpenGL.
- Abstraction Layer: Clean wrappers for OpenGL objects (Vertex Arrays, Buffers, Shaders).
- Scene Management: Modular scene system (
e::Scene) allowing for easy state switching (e.g., Main Menu to Game). - Event System: Lightweight event system (
e::Event) for decoupled communication between engine components. - Voxel Engine: Efficient chunk-based world system with dynamic loading/unloading.
- Shadow Mapping: Directional shadow mapping for the sun with PCF (Percentage Closer Filtering).
- Fog Rendering: Linear fog implementation for improved atmosphere and performance masking.
- Text Rendering: High-quality text rendering using FreeType.
- Camera System: Fully functional 3D camera with mouse and keyboard input handling.
- Lighting: Basic lighting implementation with support for object materials and light source visualization.
- UI Integration: Real-time parameter tuning using ImGui.
- Modern C++: Built using C++20 standards.
- Graphics API: OpenGL 4.5, GLSL 330
- Windowing & Input: GLFW
- OpenGL Loader: GLAD
- Mathematics: GLM
- Font Rendering: FreeType
- GUI: ImGui
- Build System: CMake
- A C++20 compatible compiler (e.g., MSVC 2019+, GCC 10+, or Clang 10+).
- CMake 3.16 or higher.
-
Clone the repository:
git clone https://github.com/Pekos123/VoxelEngine.git cd VoxelEngine -
Create a build directory and configure:
mkdir build cd build cmake .. -
Build the project:
- Windows:
cmake --build .
- Windows:
After building, you can run the sandbox executable located in the build output directory.
Note: Currently, the sandbox expects shaders to be located relative to the executable path. Ensure the
engine/shadersdirectory is accessible.
engine/: Core engine library containing the abstraction layer.include/: Header files for the engine.src/: Implementation of engine components.shaders/: Default GLSL shader files (Object, UI, Outline, Shadow).
sandbox/: A demo application demonstrating engine usage.external/: Third-party dependencies (GLFW, GLM, GLAD, ImGui, OpenSimplex).textures/: Project-wide texture assets (moved from engine/textures).
- W/A/S/D: Move the camera.
- ESC: Focus/Unfocues window game.
- Mouse: Rotate the camera view.
- Left Click/Right Click: Remove/Place blocks.
- ImGui Windows: Adjust object colors, light position, and camera sensitivity in real-time.
This project is open-source and available under the MIT License.