In the original Doom engine, a flat is an image that is drawn on the floors and ceilings of sectors. Since the original Doom renderer draws walls and sprites vertically (column after column), but floors and ceilings horizontally (line after line), the native Doom format for flats is a row-major raw image format.
Heretic features a few 64x65 flats, and Hexen a few 64x128 flats. Those were used to "cheat" with the implementation of scrolling effects. ZDoom does not need the same hacks to make flats scroll properly, and therefore ignores the excess pixels in these flats.
Finally, as an extended feature, 128x128 and 256x256 flats are supported as "hi-res" flats, which will be automatically be scaled down to fit in a 64x64 map unit square. This feature has since been deemed a bad idea, however it is retained for the sake of backward compatibility. Additional features, such as ACS functions, TEXTURES definition or UDMF properties, allow to correct the scaling if needed.
However, ZDoom features a unified texture manager which allows to use any of the supported image formats anywhere. There exist therefore the need to make the distinction between the three different things that "flat" may mean in ZDoom:
- The image format, which technically has no significance for ZDoom. The texture manager will convert it to an internal format when the flat is loaded.
- The namespace, which is used to prioritize lumps with identical names. If both a flat and a wall texture have the same name, and a sector uses that name for its floor or ceiling texture, the image which is in the flat namespace will have priority. Another effect is that intermission backgrounds and similar pictures, if they are in the flat namespace, will be tiled (instead of stretched to fit the screen).
- The texture placed on floors and ceilings. This can be in any format in ZDoom. If the format supports transparency, transparent pixels will be rendered as black (using the palette's darkest color as the black color).