How bollu/optics works
Optics is an interactive ray-marching demo for signed-distance-function lens optics. The main loop selects among five scenes with Tab/Shift-Tab; scenes respond to pointer and wheel input, trace rays through lens geometry, and render optical behavior. The README highlights defocus, aperture-versus-sharpness, and thin-versus-thick lens comparisons. The shared header defines SDF geometry and material queries. Scene files are represented as distinct demonstrations; raygui is not shown because the sampled runtime does not establish its use. Relationships are based on excerpts and README statements.
Main entry points: main.cpp Window and Scene Loop · optics.h SDF Geometry and Materials · scenea.cpp Lens Ray Tracing · sceneb.cpp Ray-Step Visualization
Components 8
Application
- Window and Scene Loop
main.cpp
Optics Core
- SDF Geometry and Materials
optics.h
Optics Demonstrations
- Lens Ray Tracing
scenea.cpp - Ray-Step Visualization
sceneb.cpp - Importance Sampling
scenec.cpp - Aperture and Screen
scened.cpp - Exposure and Depth of Field
scenef.cpp
Other components
- Viewer
Connections 11
- Viewer → Window and Scene Loop: select scene
main.cpp - Window and Scene Loop → Lens Ray Tracing: dispatches
main.cpp - Window and Scene Loop → Ray-Step Visualization: dispatches
main.cpp - Window and Scene Loop → Importance Sampling: dispatches
main.cpp - Window and Scene Loop → Aperture and Screen: dispatches
main.cpp - Window and Scene Loop → Exposure and Depth of Field: dispatches
main.cpp - Lens Ray Tracing → SDF Geometry and Materials: queries SDF
scenea.cpp - Ray-Step Visualization → SDF Geometry and Materials: queries SDF
sceneb.cpp - Importance Sampling → SDF Geometry and Materials: queries SDF
scenec.cpp - Aperture and Screen → SDF Geometry and Materials: queries SDF
scened.cpp - Exposure and Depth of Field → SDF Geometry and Materials: queries SDF
scenef.cpp