A cross-platform C++ OpenGL renderer supporting glTF scene loading with a PBR metal-roughness shader pipeline.
- Compilation on macOS, Ubuntu 24.04, Debian 12, Windows 11
- glTF scene loading via tinygltf
- PBR shader pipeline (metal-roughness workflow)
- Image-based lighting (IBL) with equirectangular HDR environment maps
- ImGui settings panel (sliders, checkboxes, native file dialog for scene selection)
- GoogleTest coverage for module structs and classes
- CMake + vcpkg cross-platform build system
- CI workflows for cross-platform compilation and continuous testing with versioned packages
- CPack packaging for Linux (DEB, TGZ, ZIP), macOS (TGZ, ZIP), Windows (ZIP) and Web (TGZ)
- Web port via Emscripten
- PBR fragment shader with switchable
fragmentColorfor inspecting intermediate outputs (optional) - USD scene loading (optional)
- Skeletal animation (optional)
- Mobile support via JNI (Kotlin) and Swift native interface (optional)
- CMake ≥ 3.10
- vcpkg (bootstrapped via
third-party/vcpkgsubmodule) - For glTF sample scenes:
git submodule update --init assets/scenes/glTF-Sample-Models - For web builds: Emscripten SDK
pre-commit (formatting and linting — no build required):
pip install pre-commit
pre-commit run --all-filesclang-tidy (static analysis — requires a compilation database):
cmake -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_LIB=ON -DBUILD_APP=ON -DBUILD_TEST=OFF \
-DCMAKE_TOOLCHAIN_FILE=/tmp/vcpkg/scripts/buildsystems/vcpkg.cmake
# All files
find modules apps -name '*.cpp' | grep -v third-party \
| xargs -P$(nproc) clang-tidy -p build --config-file=.clang-tidy
# Changed files only (faster during development)
git diff --name-only HEAD | grep '\.cpp$' \
| xargs clang-tidy -p build --config-file=.clang-tidySonarCloud (deep semantic and security analysis — requires a SonarCloud account):
# Prerequisites
brew install sonar-scanner # macOS
export SONAR_TOKEN=<your-token>
# Run locally
./scripts/sonar-scan.shResults are published to sonarcloud.io. All three checks run automatically in CI on every pull request and push to main.
Desktop build:
cd scripts/
./build.sh -CMakeToolchainFile ../third-party/vcpkg/scripts/buildsystems/vcpkg.cmake -ReleaseWith tests:
cd scripts/
./build.sh -CMakeToolchainFile ../third-party/vcpkg/scripts/buildsystems/vcpkg.cmake -RunTestsWith versioned package suffix:
cd scripts/
./build.sh -CMakeToolchainFile ../third-party/vcpkg/scripts/buildsystems/vcpkg.cmake -Release -RevisionNumber alpha-1Web build:
cd scripts/
source <path-to-emsdk>/emsdk_env.sh
./build.sh -WebBuild
# Copy build artifacts (.js, .wasm, .data) to assets/web/html-js-wasm
# Start the nginx dev container in .devcontainer/nginx, copy artifacts to /usr/share/nginx/html
# Open http://localhost:8090/rotating_textured_cube.html or http://localhost:8090/opengl_viewer.htmlPackaging:
cd build/
cpack --config CPackConfig.cmake -G DEB # Linux
cpack --config CPackConfig.cmake -G TGZ # Linux / macOS
cpack --config CPackConfig.cmake -G ZIP # Linux / macOSDesktop build:
cd scripts\
.\build.ps1 -CMakeToolchainFile ..\third-party\vcpkg\scripts\buildsystems\vcpkg.cmake -ReleaseWith tests:
cd scripts\
.\build.ps1 -CMakeToolchainFile ..\third-party\vcpkg\scripts\buildsystems\vcpkg.cmake -RunTestsWith versioned package suffix:
cd scripts\
.\build.ps1 -CMakeToolchainFile ..\third-party\vcpkg\scripts\buildsystems\vcpkg.cmake -Release -RevisionNumber alpha-1Packaging:
cd build\
cpack --config CPackConfig.cmake -G ZIP| App | Description |
|---|---|
| opengl-viewer | Full PBR viewer with IBL and ImGui settings panel |
| rotating-textured-cube | Minimal textured cube demo |