How ultrich-ea2/iterative-ray-tracing works
This is an interactive C++ ray tracer: the application builds a scene and camera, renders pixels through a recursive ray-coloring loop, then displays the image and rerenders when keyboard input changes the camera. Rendering includes parallel workers, adaptive sampling, and scaled previews; scene geometry includes spheres, boxes, and the split box, with textured and reflective/refractive materials. The graph follows the shown calls and documented capabilities; unsampled headers are included where the README and source index establish their role, but their internal behavior is not inferred.
Main entry points: main.cpp Scene and controls · camera.h Camera rays · parallel_render.h Parallel scaled renderer · split_box.h Split box
Components 16
Application
- Scene and controls
src/main.cpp
Rendering
- Recursive ray color
src/main.cpp - Parallel scaled renderer
include/parallel_render.h - Camera rays
include/camera.h
Scene and geometry
- Scene object list
include/hittable_list.h - Sphere geometry
include/sphere.h - Box geometry
include/box.h - Axis-aligned rectangles
include/aarect.h - Split box
include/split_box.h
Shading
- Material scattering
include/material.h - Color textures
include/texture.h
Ray primitives
- Hit interface
include/hittable.h - Ray representation
include/ray.h - Vector math
include/vec3.h
Other components
- Keyboard user
- SDL display
Connections 25
- Keyboard user → Scene and controls: controls
src/main.cpp - Scene and controls → Scene object list: builds scene
src/main.cpp - Scene and controls → Sphere geometry: adds spheres
src/main.cpp - Scene and controls → Box geometry: adds boxes
src/main.cpp - Scene and controls → Split box: creates split box
src/main.cpp - Scene and controls → Material scattering: creates materials
src/main.cpp - Scene and controls → Color textures: creates textures
src/main.cpp - Scene and controls → Camera rays: configures camera
src/main.cpp - Scene and controls → Parallel scaled renderer: requests rendering
src/main.cpp - Scene and controls → SDL display: updates image
src/main.cpp - Parallel scaled renderer → Camera rays: generates rays
include/parallel_render.h - Parallel scaled renderer → Recursive ray color: shades rays
include/parallel_render.h - Recursive ray color → Scene object list: tests hits
src/main.cpp - Recursive ray color → Material scattering: scatters hit
src/main.cpp - Camera rays → Ray representation: constructs rays
include/camera.h - Scene object list → Hit interface: tests objects
include/hittable_list.h - Sphere geometry → Hit interface: implements hits
include/sphere.h - Box geometry → Axis-aligned rectangles: builds sides
include/box.h - Split box → Box geometry: builds upper half
include/split_box.h - Split box → Axis-aligned rectangles: builds lower shell
include/split_box.h - Material scattering → Color textures: samples albedo
include/material.h - Hit interface → Ray representation: receives rays
include/hittable.h - Ray representation → Vector math: uses vectors
include/ray.h - Camera rays → Vector math: calculates directions
include/camera.h - Color textures → Vector math: returns colors
include/texture.h