Wessel Frijters

Engine/Tools programmer

DXX-Raytracer

In the third year of my study at BUas, as a team of 7, we were challenged to add raytracing to the retro classic: Descent.

One of the biggest challenges was navigating the old C codebase and injecting our code to do raytracing instead of rasterization.

In this team project I’ve mainly been responsible for:
– Level geometry
– Lights
– Tools
– CI

The project was covered by PC Gamer

Tech behind DXX Raytracer

Descent with and without raytracing

Global Illumination

One of the most notable changes to the original game must be the path-traced global illumination.

A good example of where this effect would be visible is the lava falls in the image on the left. You can see that the original game uses some white light to light up the level. With our path-traced global illumination, you can see how diffuse surfaces (such as the walls) propagate the light from the emissive surfaces (in this case the lava falls) through the scene.

For this to work, the textures had to be marked as emissive. This led me to go through the original game’s source code and find the textures that would normally act as a light source, these textures were then marked as emissive.

Level Geometry

When the game was released in 1995, the game was one of the first to have fully 3D traversable spaces. This was achieved by representing the level as a series of cubes. Each side of the cube could connect to another cube (in which case no wall gets drawn), render a door/window or show a wall. Each side of the cube is stored as a quad.

Modern games, however, don’t typically render their geometry with quads and use triangles instead. So the first step for me to get the level geometry rendering was triangulating the quads.

When it comes to raytracing, it is also widespread to make use of a top-level acceleration structure (TLAS) and a bottom-level acceleration structure (BLAS), where a BLAS usually covers ray intersections on individual objects, for example, a single instance of an enemy. The TLAS is responsible for the global intersection checks for objects, and points to the corresponding BLAS to handle the intersection further.

Extracted Level Geometry (left) and with textures applied (right)