An OpenGL-based renderer built as an evolution of my previous software renderer. This version uses modern OpenGL and GPU shaders instead of doing all rendering calculations by hand.
Check out the devlog below for a walkthrough of the renderer in action.
Following LearnOpenGL and documenting everything I learn in notes.txt.
See my notes on everything I've learned so far.
Clone with submodules:
git clone --recursive https://github.com/EricHayter/renderer2
cd renderer2If you already cloned without --recursive:
git submodule update --init --recursiveBuild:
mkdir build
cd build
cmake ..
cmake --build .
./src/renderer ../models/plant.objOnce you have everything built, fly around with w a s d or arrow keys. Hold space to go up, shift to go down. Right-click and drag to look around. Hit esc to exit.
By default, the renderer supports:
- OBJ (
.objand.mtl) - Wavefront OBJ format with external textures - glTF (
.gltfand.glb) - GL Transmission Format with embedded textures
To enable additional formats (FBX, COLLADA, Blender, STL, etc.), edit CMakeLists.txt and uncomment the desired importer. For example, to add FBX support:
set(ASSIMP_BUILD_FBX_IMPORTER ON CACHE BOOL "" FORCE)See CMakeLists.txt for the full list of available importers. After changing importers, rebuild from scratch:
cd build
rm -rf *
cmake ..
cmake --build .The renderer is organized into distinct classes handling windowing, rendering, models, and materials. See the diagram above for the relationships between major components.
This project uses the following third-party libraries:
- OpenGL 3.3 Core - Modern graphics API for GPU-accelerated rendering
- GLFW - Cross-platform windowing, input handling, and OpenGL context creation
- glad - OpenGL function loader generated for OpenGL 3.3 Core Profile
- GLM - Header-only mathematics library providing vector and matrix operations matching GLSL
- Assimp - Asset import library for loading 3D models (currently: OBJ, glTF/GLB) with material and texture support
- stb_image - Single-header image loading library for texture data (PNG, JPG, etc.)
- ImGui - Immediate mode GUI library for runtime debugging and parameter tweaking
- CMake - Build system for managing compilation across platforms




