WAL

From Valve Developer Community
Revision as of 09:59, 30 August 2023 by SirYodaJedi (talk | contribs) (→‎Surface flags: Vmt lonks)
Jump to navigation Jump to search
English (en)Translate (Translate)

WAL is a texture file format used by Quake II Quake II to store brush textures. A single WAL file contains one miptex, as well as three metadata values. The first two metadata values are bitflags, indicating information about a brush's face (surface flags) and a brush's contents (content flags). The third metadata value is an integer value, traditionally used for determining the brightness of texlights (although some compilers use it for other purposes on non-emissive surfaces, such as for smoothing groups in Arghrad).

The surface flags and content flags found in WAL files would serve the basis for the material map compile flags used by Source Source 1.

Texture flags

These sections list and describe the various standard surface and content flags used in Quake II Quake II, as well as the equivalent VMT parameters to achieve the same result in Source Source 1.

Surface flags

Surface flags on different faces of a brush generally do not need to match.

Bit Flag name VMT equivalent Description
0x00000001 SURF_LIGHT N/A Treats this face as a texlight, with brightness dependent upon the surface value.
0x00000002 SURF_SLICK N/A Makes this face slippery to walk on.
0x00000004 SURF_SKY Face is is not drawn, and the skybox is drawn behind all visible faces when this face is in the PVS.
0x00000008 SURF_WARP Potentially simulatable using material proxies "Warp" the texture on this face, like water.
0x00000010 SURF_TRANS33
$alpha "0.33"
Render the face as translucent, at 33% opacity.

Most source ports, including the remaster, will render any texels using palette index 255 (or true color images with a alpha of less than 127) as fully transparent.

0x00000020 SURF_TRANS66
$alpha "0.66"
Render the face as translucent, at 66% opacity.

Most source ports, including the remaster, will render any texels using palette index 255 (or for 32-bit textures, texels with an alpha of less than 127) as fully transparent.

0x00000040 SURF_FLOWING TextureScroll material proxy Texture scrolls from top to bottom. Requires SURF_WARP.
0x00000080 SURF_NODRAW Do not render this face in-game.
0x00000100 SURF_HINT Used on hint brushes.
0x00000200 SURF_SKIP Completely ignore. Causes unexpected results when applied to anything other than hint brushes.
0x02000000 SURF_ALPHATEST (not in Vanilla) Use binary transparency, using either palette index 255 of an 8-bit texture or the alpha channel of 32-bit texture as a transparency mask.
0x10000000 SURF_N64_UV
$basetexturetransform "center .5 .5 scale 0.5 0.5 rotate 0 translate 0 0"
(not in Vanilla) Halves texture sizes, without requiring setting texture scale in the editor to 2.0.
0x20000000 SURF_N64_SCROLL_X TextureScroll material proxy (not in Vanilla) Scrolls the texture on the X axis. Slower than SURF_FLOWING.
0x40000000 SURF_N64_SCROLL_Y TextureScroll material proxy (not in Vanilla) Scrolls the texture on the Y axis. Slower than SURF_FLOWING.
0x80000000 SURF_N64_SCROLL_FLIP TextureScroll material proxy (not in Vanilla) Inverts the scroll direction.

Content flags

Content flags on different faces of a brush almost always need to match. Mismatched contents will result in compiler errors, and leaves it up to the compiler to decide what contents a brush should have. The exception to this rule is the "current" flags.