Compute-Ray-Tracer is a compute shader-based ray tracing engine designed to render realistic 3D scenes with GPU acceleration. This project is a work-in-progress and serves as a foundation for experimenting with ray tracing concepts.
- Compute Shader Acceleration: Leverages GPU compute cores for ray tracing.
- Single Model Support: Load and render one 3D model at a time.
- Baked Material: Uses a default material applied to the model.
- Ambient Lighting: Currently supports one global ambient light source.
- Semi high-Quality Output: Render images with realistic shading and shadows.
The project is actively under development. Many features are still being implemented:
- Load a single 3D model (OBJ)
- Render with default baked material
- Ambient lighting
- Fixed camera setup
- SAH based BVH splitting
- Support multiple models
- Support multiple materials
- Add movable camera
- Add multiple light sources
- Post-processing effects (e.g., tone mapping, gamma correction)
- Performance optimizations
- UI for scene configuration
Clone the repository:
git clone https://github.com/yourusername/Compute-Ray-Tracer.git
cd Compute-Ray-Tracer
Build using CMake:
mkdir build
cd build
cmake ..
make
./ComputeRayTracer
- Program will ask the Path to your 3D model file.
- W / A / S / D – Move camera forward / left / backward / right
- Space – Move camera up
- Left Ctrl – Move camera down
- Mouse – Look around (when cursor is locked)
- Tab – Toggle mouse lock/unlock (enables/disables camera look)
- R - Resets the FPS, frame count and elapsed time
- Esc – Quit application
Compute-Ray-Tracer/
│
├─ src/ # Source code
├─include/ # Header files
├─resource/ # Contains shader files
├─models/ # Sample 3D models
└─CMakeLists.txt # Build configuration
Contributions are welcome! You can help by:
- Adding new material shaders
- Implementing movable camera
- Supporting multiple light sources
- Optimizing performance
- Adding UI and scene management features
This project is licensed under the MIT License. See LICENSE.
- TinyOBJLoader – For OBJ model loading
- Inspired by Sebastian Lague’s Ray Tracing Series tutorials
- Inspired by modern GPU ray tracing tutorials and research