← All projects

Rendering / CUDA / OpenCL

Doom 3 Path Tracing

A GPU path tracer inside a game engine that was never designed for one.

Context
Personal rendering experiment
My work
Engine integration, GPU backends, and renderer investigations
Built on
dhewm3 / idTech 4

Two ways to draw the same scene.

Two captures from the same viewpoint. Lighting, material handling, and HUD output differ: this is a visual example, not an exposure-matched comparison or a performance benchmark.

Doom 3 corridor rendered with OpenGL, with a bright orange fire and dark walls
OpenGL rasterizerThe original rendering path.
The same Doom 3 corridor in the path tracer, with illuminated wall panels and indirect light
GPU path tracerA 32-sample-per-pixel path-traced capture.

The project

I wanted to keep Doom 3’s world, lights, and gameplay, but replace the way it draws a frame. Built on the dhewm3 source port, this personal project takes the geometry and lights submitted by the engine and feeds them into a GPU path tracer instead of the stock rasterizer.

What I built

What came out of it

The work grew from a first playable renderer into a study of material fidelity, backend portability, and renderer correctness. The articles cover both the implementation and the mistakes that shaped it, including the limits of individual benchmark and image-quality comparisons.

The writeups also describe the AI-assisted parts of development, particularly the backend refactor and material-rendering work.

The demo-capture experiments also led to d3ptmark, using recorded Doom 3 views with a controlled sample budget.

Code and demos

Behind the project

Read the story, in order.

  1. Implementing a CUDA Path Tracer Inside Doom 3
  2. Refactoring Doom 3's Path Tracer: CUDA, OpenCL, and Renderer Correctness