A simple ray tracer with BVH acceleration, built with C++ and OpenGL (OpenGL only for quick iteration, switching to Vulkan later). This project starts as a real-time renderer, BVH visualization tools, and shader tester. But after the renderer is matured this will become a Game Engine.
- BVH Acceleration: Spatial acceleration structure for fast ray-scene intersection
- Real-time Rendering: Interactive rendering with camera controls
- Debug Visualization: Multiple BVH visualization modes:
- Bounding box hierarchy
- Bounding Box intersection test counts
- Triangle intersection test counts
- Shader Hot-Reloading: Edit shaders and see changes in real-time
- Mesh Import: Supports most common mesh formats with automatic optimization
- Performance Metrics: Detailed BVH statistics and rendering timings
- GPU ray tracing via compute shaders
- Physically-based materials
- CMake 3.20+
- C++20 compatible compiler
- OpenGL 4.6
- GLFW
- GLEW
- Assimp
- MeshOptimizer
git clone git@github.com:Mich-Dich/gluttony.git
cd gluttony
vendor/premake/premake5 gmake2 && make -jreplace <your_arcetecture> with the arcetecture you want to use, typicly only one available. eg: Debug-linux-x86_64
bin/<your_arcetecture>/gluttony_editor/gluttony_editor- Mouse Right Button + WASD/space/left Control: Move camera
- Mouse Right Button + Mouse: Look around
- Mouse Right Button + Mouse wheel: Move faster/slower
Toggle in the debug UI:
- Bounding Boxes: Visualize BVH hierarchy
- Box Tests: Show intersection test counts
- Triangle Tests: Visualize triangle traversal
- Compact BVH node structure (32 bytes per node)
- SAH (Surface Area Heuristic) for optimal splits
- Binned SAH evaluation for performance
- Multi-threaded BVH construction
- SSBOs for geometry data transfer
- Optimized triangle intersection
Typical performance on my NVIDIA GeForce RTX 3060 Laptop:
- BVH build time: 15-40ms for complex meshes
- 2-5ms BVH traversal for primary rays
Contributions are welcome! Please open an issue or pull request for any:
- Bug fixes
- Performance improvements
- New features
- Documentation updates
MIT License - see LICENSE for details.
