Download

D2X-XL Worklog

Notes on features and problems from the development of D2X-XL, newest first.

Textures

Rework

Descent's original textures are small and flat, and the new renderer needs more than that: displacement mapping and lighting need to know for every spot of a texture how deep it lies, which way it faces and how shiny it is.

So all textures of Descent 1 and Descent 2 have been reworked. They have been upscaled from the originals, and each one has got a normal map and a map holding its height, ambient occlusion and specularity.

The upscaling is automatic, and so is deriving the maps from a texture's height. The height itself is the problem. It can be taken from the brightness of a texture, which works well enough for rock. But a tool cannot tell from a picture what stands out and what lies deep, and with brightness as height every painted highlight, shadow, rust stain and letter turns into relief.

For a few hundred textures - metal, robots, doors, lamps, signs - the height therefore comes from a hand made mask, and a lot of manual work went into these. Hand made doesn't mean painted: every mask is constructed from geometric shapes that are placed on the texture exact to the texel. Edges, bevel widths and centers were measured in the texture; a bevel is as deep as it is wide; round parts have truly round profiles, so a pipe is half a cylinder and the hub of a fan is a cone. What is only painted on a texture stays flat.

Doors got masks that follow their animation: the leaves of a door move with their relief, and the blades of the iris door turn about their pivots.

All masks share one scale, so a groove of a given width is as deep in one texture as it is in any other.

Displacement Mapping

Descent's walls are flat faces with a texture on them; whatever structure a wall seems to have is only painted on.

D2X-XL now gives textures depth. The renderer uses the height map of a texture to let grooves, plates and rock sink into the wall or stand out of it. Lighting follows the relief, too, be it the light of the lamps in the level, of weapon fire or of your headlight. Robots and other models get relief as well once they are large enough on the screen.

Overlays

Descent cannot model small things like lamps, signs or fans as geometry. Instead it paints a second texture over the base texture of a wall: an overlay. This is a historical hack, a cheap substitute for elements that would really have to be modelled in 3D, lamps in particular.

With relief this hack becomes a problem. Base texture and overlay both have a height now, and an overlay simply painted over a base texture with relief would follow all its bumps and dents, or sink into them.

So an overlay now sits on the highest point of its base texture; parts that are built flush into the wall, like fans, sit on its mean height instead. Base texture and overlay are treated as one surface, so a lamp standing out of the wall hides the wall next to it when you look at it from the side. And every texture can bring its own depth, which is stored in the file of its height map.

Displacement mapping is active with render quality set to medium or high and lighting quality set to high or ultra high. Textures without a height map remain flat.