CUSTOM RAY TRACER

A custom ray tracer, built in Python and OpenGL

A renderer that supports arbitrary mesh geometry with sphere, triangle-mesh, and AABB intersection. The ray tracer also contains a full lighting/shading pipeline with shadow rays, lights with quadratic attenuation, and anti-aliasing via camera jitter. The project also includes a JSON parser for easy scene creation.

Private GitHub repository, available upon request.

Python + OpenGLstack
Sphere / Mesh / AABBintersection
Directional / Point / Arealights
4additional effects
Featured effects

Four effects added to the base renderer

IMAGE / VIDEO
01 — REFLECTION

Recursive reflection

Reflects the ray hitting a reflective surface and shades the object using whatever the reflected ray hits. This is applied recursively across a set number of bounces.

IMAGE / VIDEO
02 — REFRACTION

Refraction

Applies Snell's law with a constant index of refraction (η = 1.0 / 1.7) to bend rays through refractive surfaces, distorting what sits behind them. In the sample image, the main sphere has a blue sphere behind it that is being flipped as a result of the refraction.

IMAGE / VIDEO
03 — SOFT SHADOWS

Area lights & soft shadows

Samples different points across a square frame, treating each sample as a unique point light with its own position. The different light contributions are averaged with the total number of samples to create a soft lighting effect.

IMAGE / VIDEO
04 — DEPTH OF FIELD

Depth of field blur

Samples random points on a unit circle, emitting rays from those random points towards a focal point. The rays converge on the focal point (where the image is clearest) and diverge elsewhere, so that unfocused areas appear blurry.

Master scene

Every effect above combined in a single SUPER HOT–inspired scene.

IMAGE / VIDEO
← Fullscreen FX & Post Games →