Flat and texture mixing

From DoomWiki.org

Revision as of 03:38, 12 July 2020 by Gez (talk | contribs) (Created page with "'''Flat and texture mixing''' is a feature present in some source ports allowing to place flats on walls and wall textures on floors and ceilings. In the orig...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Flat and texture mixing is a feature present in some source ports allowing to place flats on walls and wall textures on floors and ceilings.

In the original Doom engine, texture mapping uses different image formats for different types of surfaces: vertical surfaces (walls and sprites) are drawn by columns, while horizontal surfaces (floors and ceilings) are drawn by rows (note that skies are vertical surfaces). This allows the engine to use the same scaling for the entire line of pixels, and the image formats are designed accordingly. The result is that flats are in the wrong format for walls, and wall textures are in the wrong format for floors and ceilings. The first step to allow to mix flats and textures on any surface type is therefore to have a texture manager able to transform pixel data into the format expected by the renderers; this is also a step needed for supporting other image formats such as PNG.

One issue when implementing flat and texture mixing is that nothing prevents flats and textures from having the same name. For example, the classic Doom games feature a STEP1 and STEP2 pair of flats, as well as STEP1 and STEP2 wall textures. The flats are used to represent the surface of a stair step or lift, while the textures are used to represent the riser of a step. They are completely different in design and dimensions, so they cannot be used interchangeably. The port needs then to implement a priority system so that if a name exists as both a flat and a texture, it will use the flat on a floor or ceiling and the wall texture on a wall. In turn, this means that only uniquely named graphics can be used on both flats and walls: it is not possible, for example, to use the flat version of STEP1 vertically.

Ports allowing flat and texture mixing