graphics · sub-star
photon_tracer
CPU raytracer built with no graphics libraries at all.
readme
A raytracer written from scratch in C++ that computes where light rays intersect 3D geometry and generates images from nothing but math. No graphics library is involved anywhere. the vector algebra, the camera, the intersection tests, and the image file format are all hand-written.
artifact
not simulated: this sphere is raytraced in your browser, scanline by scanline.
signal log
- foundational rendering math built by hand: 3D vector operations, ray generation, and camera positioning.
- modular hittable interface for ray-object intersection, currently rendering spheres accurately.
- writes the finished scene straight to a PPM image, handling raw pixel data without an image library.
- configurable anti-aliasing and sampling (around 50 rays per pixel) to trade render time against fidelity.
- threads claim rows from a shared counter instead of fixed bands, since sky rows finish long before ground rows: 1080p at 50 spp went from 0.98 s to 0.67 s, about 375M rays/s.
- the browser build runs the same render_row in one Web Worker per thread, within about 15% of native throughput.
built with
C++17WebAssembly