From SRB2 Wiki
(Redirected from Textures)
Jump to: navigation, search
Test.png This article or section is outdated and has not been updated to reflect the release of SRB2 v2.2.

Please help the Wiki by correcting or removing any misinformation, as well as adding any new information to the page.

This article is about the graphics that are displayed on walls. For the graphics that are displayed on floors and ceilings, see Flat.
"Textures" redirects here. For a list of flats and textures that are used in SRB2, see Flats and textures.

A texture is a graphic that is displayed on the wall surfaces of a linedef in a map. A texture can be either a single image or a composite of several smaller images.


Textures are stored as lumps of image data. Instead of storing the color value of each pixel directly, textures simply store an index number that corresponds to an entry in the game's palette of 256 colors. Therefore, changing the palette that is used by the game will also change the appearance of all textures. Graphics editing software with palette support, such as GIMP, can load custom palettes from paletted images or from a PLAYPAL lump, for textures that may require them.

There are two ways of creating textures out of the stored images: One is to use the images directly as textures. The other is to combine several individual images into a composite texture. In this case, the individual images are called patches. While the direct method is simpler, the composite method is useful for textures in which parts of the texture are repeated multiple times. Since the repeating parts are stored only once as images, the composite version of the texture takes up less space than the direct version would.

Composite textures are defined in special text lump called TEXTURES. The definition of a composite texture consists of its name, its size, and a list of the included patches along with their overall position in the texture. The format of the TEXTURES lump is taken from the Doom source port ZDoom. Some lump editors, such as SLADE, recognize this format and provide a graphical editor for creating composite textures. However, since TEXTURES is a plain text lump, even lump editors that do not recognize it can be used to edit it in text form. See the section below for information on how the contents of the lump are formatted.

In PK3 files, images that are used directly as textures must be placed in the Textures/ folder in order to be recognized by SRB2. In WAD files, they must be placed between empty marker lumps called TX_START and TX_END. Images that are only used as patches in composite textures can be stored anywhere, but for easy navigability they are often placed in the Patches/ folder (in the case of PK3 files) or between empty marker lumps called P_START and P_END (in the case of WAD files).


The general format of a texture defined in the TEXTURES lump is the following:

walltexture TEXTNAME, width, height {
	patch P1NAME, x1, y1
	patch P2NAME, x2, y2

Each texture definition starts with the keyword walltexture. Following this, TEXTNAME is a name of your choice up to eight characters long that is unique to the texture itself – ideally this should not match the name of any of the patches the texture consists of. width and height determine the dimensions of the full texture in pixels; note that the restrictions given in the section above for widths and heights still apply here.

Within the pair of braces, { and }, is the list of patches the texture consists of. This can be as many patches as necessary for the texture, and can even include multiple copies of the same patch at different positions.

Each line for an individual patch in the texture must start with the keyword patch. Following this is the name of the patch to use – this can be the name of any existing patch located in the WAD or PK3 file, including single-patch textures already defined in the Textures/ folder or between the TX_START and TX_END markers, respectively. After this are the X and Y coordinates the top-left corner of the patch is located at, relative to the top-left corner of the space within the texture itself. Note that the X coordinate is measured from the top edge of the texture downwards, and the Y coordinate is measured from the left edge of the texture going to the right.


An example of a composite texture included with SRB2 is GFZROCK. It is 128×128 pixels in size, and is built from four 64×64 patches for each of its four squares within: two GFZTIL01 patches, and two GFZTIL02 patches. The text below is this texture's definition directly taken from srb2.srb's own TEXTURES lump.

walltexture GFZROCK, 128, 128 {
	patch GFZTIL01, 0, 0
	patch GFZTIL02, 64, 0
	patch GFZTIL02, 0, 64
	patch GFZTIL01, 64, 64


Textures can contain transparent pixels. XWE will automatically convert any pixels with the palette index 255 (cyan) to transparency. SLADE allows the user to pick the color that is converted to transparency, which makes it possible to use non-transparent cyan pixels in a texture – however, this only works for textures that use only a single patch; composite textures will not draw cyan pixels regardless of this. Aside from allowing for partially transparent textures, this also allows for partially transparent patches to be laid on top of entirely opaque patches to create more detailed composite textures.

Partially transparent textures should only be used on middle textures, or any type of FOF that doesn't have the FF_CUTSOLID flag (such as linedef types 220 or 222). Otherwise, the tutti-frutti effect will occur. Textures with multiple patches will never display pixels with palette index 255 on middle textures or FOFs without FF_CUTSOLID, regardless of whether the textures are partially transparent or not, and those pixels will instead be treated as if they were transparent areas. On the other hand, textures with a single patch can display palette index 255 on these same areas of a map only if they are also partially transparent.

See also