Getting Started
This guide will help you run your first render in 5 minutes.
Requirements
| Component | Version |
|---|---|
| CUDA Toolkit | 11.0+ |
| C++ Compiler | C++17 support |
| CMake | 3.18+ |
| GPU | Compute Capability 7.5+ (Turing+) |
Installation
1. Clone the Repository
bash
git clone https://github.com/AICL-Lab/ray-tracer.git
cd ray-tracer2. Build
bash
# Configure
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
# Compile
cmake --build build -j$(nproc)3. Run
bash
# Blinn-Phong shading (fast preview)
./build/bin/ray_tracer -o output.ppm
# Path tracing (high quality)
./build/bin/ray_tracer --scene cornell -p -s 128 -o cornell.ppmView Results
The output is in PPM format. Convert to PNG:
bash
# Using ImageMagick
convert output.ppm output.png
# Using Python
python -c "from PIL import Image; Image.open('output.ppm').save('output.png')"Next Steps
- CLI Reference - All command-line options
- Algorithms - Deep dive into BVH acceleration
- API Reference - Complete API documentation
Troubleshooting
CUDA Version Mismatch
Ensure CUDA Toolkit matches your GPU driver:
bash
nvcc --version
nvidia-smiCUDA Not Found
Set the CUDA_PATH environment variable:
bash
export CUDA_PATH=/usr/local/cuda
export PATH=$CUDA_PATH/bin:$PATHOut of Memory
Reduce resolution or sample count:
bash
./build/bin/ray_tracer -w 640 -h 480 -s 32 -o output.ppm