Skip to content

A compute shader-based ray tracing engine for realistic 3D rendering with BVH acceleration and advanced lighting.

License

Notifications You must be signed in to change notification settings

Auth0x78/Compute-Ray-Tracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compute-Ray-Tracer

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.

Core Features

  • 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.

Current Status & TODO

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

Screenshots

image

Installation

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

Usage

./ComputeRayTracer
  • Program will ask the Path to your 3D model file.

Controls

  • 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

Project Structure

Compute-Ray-Tracer/
│
├─ src/                # Source code  
├─include/             # Header files  
├─resource/            # Contains shader files
├─models/              # Sample 3D models
└─CMakeLists.txt       # Build configuration

Contributing

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

License

This project is licensed under the MIT License. See LICENSE.

Acknowledgements

  • TinyOBJLoader – For OBJ model loading
  • Inspired by Sebastian Lague’s Ray Tracing Series tutorials
  • Inspired by modern GPU ray tracing tutorials and research

About

A compute shader-based ray tracing engine for realistic 3D rendering with BVH acceleration and advanced lighting.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages