A CPU ray tracer built from scratch in pure Python, following the spirit of Peter Shirley's Ray Tracing in One Weekend — organized as a professional software project.
Stack: Python · NumPy · Pillow · pytest
pip install -r requirements.txtpython src/main.py
# Output → renders/phase1_red_sphere.pngpytest tests/ -vsrc/
main.cpp
ray.h
vec3.h
renders/ — Output images (git-ignored)
| Phase | Feature |
|---|---|
| 1 | Red sphere, sky background |
| 2 | Surface normals, multi-sphere |
| 3 | Lambertian diffuse |
| 4 | Metal reflections |
| 5 | Dielectric glass |
| 6 | Anti-aliasing, gamma |
| 7 | Depth of field, camera control |
| 8 | BVH acceleration |
| 9 | Multithreaded rendering |