Texture Last edited 1 month ago2024-06-11 10:51:35 UTC

The 'paint' that is applied to solids in maps. They are fundamental to level design, just behind the geometry itself. Textures are found in WAD files, which can be browsed from within Hammer and edited using tools like Wally and PAKScape.

Shift+T applies the currently selected texture to the currently selected object(s), while pressing Shift+A brings up a dialog that gives you more control over texture scaling and alignment.

Consult the Texture Application tutorial for more information on texture application.

Texture types

There are several types of textures with different properties. Usually it's defined by a prefix or suffix.

Format and dimensions

For textures used in maps, the source image files must be an 8-bit indexed bitmap (.BMP). It means that there is a palette (or list) of 256 colours maximum and each pixel of the image is one of those colours in the palette.

Some texture types look at specific palette indices for their special properties: The length of the sides of the image must be in multiples of 8, but conventionally they are in multiples of 16. This is to support the WAD3 miptex (mipmapped texture) format that uses 4 levels of mipmapping (at full, half, quarter and 1/8th resolutions). The maximum dimensions vary between engine implementations but generally 512 is conventionally taken as maximum. Larger textures need to be split into multiple parts.
Model textures
Model textures abide by similar rules with regards to being 8-bit indexed bitmaps and using the last palette index for transparent colour (if the texture is flagged as such). For full details, see the303's page on texture preparation for GoldSource models.

Textures and materials

A texture is just one part of the material system. In GoldSource this material system is used to impart materialistic properties for the textures in question, such as footstep sounds and sounds and decals when hit with a crowbar or bullets. But unlike modern game engines, the material system of GoldSource consists simply of the materials.txt file listing the materials of each texture set.
Condition Zero uses a different system, which will not be discussed here.

Detail textures

Introduced in Condition Zero, detail textures are another layer of texture applied to the base textures. It imparts detailing similar to bump mapping when a texture is viewed up close, to suggest the materials that the texture is made out of such as concrete, metal, wood, bark, snow, etc.

Detail textures are in 24-bit TGA files, where the neutral colour is gray (128 128 128, or #808080). Gray on the detail texture becomes transparent over the base texture, brighter colours creates a highlight, and darker colours darkens it. Higher contrast (deviations from the gray) suggests more roughness and vice versa. The maximum dimensions for detail textures are not clear but are usually in 128px by 128px. By convention they are placed in gfx/detail/ relative to the game/mod folder (or a subfolder within).

Detail textures are specified for each map through <mapname>_detail.txt placed beside the .bsp file. The entries consist of the texture name, the path to the detail textures relative to gfx/ folder, and the x and y multipliers. The multiplier values specifies how many times the detail textures are tiled on that axis relative to the base texture. a 4.0 value on a 64px wide texture means the detail textures repeats 4 times every 64px of the base texture, or once every 16px.

Detail textures can be enabled or disabled in game by entering the r_detailtextures 0|1 on the console.

GoldSource vs Source (and more modern engines)

The GoldSource engine's concept of textures are only in the sense of "images applied to a surface," with name affixes and special names dictating special properties. Apart from (or in addition to) the texture types listed above, render properties (such as opacity) are applied using the render properties of the brush entity where the texture is applied.

In Source, a surface is instead assigned a material described in a text-based .vmt files, and that material file in turn lists its own intrinsic properties e.g. being water or animated, material sounds and decals replacing the system described in the previous section, and associated texture or textures.

Furthermore, a texture in GoldSource is composed of only the colour + shadows baked into one image, while in Source and other more modern engines a material has more information about shininess, bumpiness, etc.

Related links

Comments

You must log in to post a comment. You can login or register a new account.