projects
Graphics / Ray tracing / 2022

miniRT.

Light, shadow and colour, computed one pixel at a time.

Role
Rendering · with Abdelhadi El Mahdi
Where
42
Built with
C · Ray tracing · Phong shading · MiniLibX

No engine, no shaders, no 3D library. Every highlight, every soft edge of colour and every shadow in these images has to be worked out by hand, from geometry and the way light falls off a surface.

Built with Abdelhadi El Mahdi. I wrote the first renderer: reading a scene, casting the rays and shading spheres, planes and cylinders. Abdelhadi carried it into the bonus — cones, coloured lights, specular highlights and multithreading.

1Mrays per image, one for each pixel
4shapes, solved as equations
03D libraries

Shapes are equations

A sphere, a plane, a cylinder or a cone is never drawn. Each one is an equation, and the ray asks it a single question: where, if anywhere, do we meet?

Light has three parts

A soft ambient fill, the diffuse light that falls off as a surface turns away, and the sharp specular highlight that makes a sphere look polished.

Shadows ask a second question

From every point the camera sees, a second ray heads for each light. If something is in the way, that light does not reach — and the point falls into shadow.

PAM