WAL: Difference between revisions
SirYodaJedi (talk | contribs) m (→Content flags) |
SirYodaJedi (talk | contribs) m (→Surface flags) |
||
| Line 20: | Line 20: | ||
| SURF_SLICK | | SURF_SLICK | ||
| N/A | | N/A | ||
| Makes this face slippery | | Makes this face slippery. | ||
|- | |- | ||
| {{mono|0x00000004}} | | {{mono|0x00000004}} | ||
| Line 35: | Line 35: | ||
| SURF_TRANS33 | | SURF_TRANS33 | ||
| {{code|[[$alpha]] "0.33"}} | | {{code|[[$alpha]] "0.33"}} | ||
| Render the face as translucent, at 33% opacity. | | rowspan=2 | Render the face as translucent, at 33% or 66% opacity, respectively. | ||
Most source ports, including the remaster, will render any texels using [[palette]] index 255 (or true color images with | Most source ports, including the remaster, will render any texels using [[palette]] index 255 (or true color images with an alpha of less than 127) as fully transparent. | ||
While these flags can technically be combined, the behavior for such is not standardized. Some engines (such as Yamagi) will prioritize one or the other, others (such as Q2EX) will render the face at 50% opacity, and a small will even render the face with binary transparency. | |||
|- | |- | ||
| {{mono|0x00000020}} | | {{mono|0x00000020}} | ||
| SURF_TRANS66 | | SURF_TRANS66 | ||
| {{code|[[$alpha]] "0.66"}} | | {{code|[[$alpha]] "0.66"}} | ||
|- | |- | ||
| {{mono|0x00000040}} | | {{mono|0x00000040}} | ||
| Line 71: | Line 72: | ||
| {{mono|0x10000000}} | | {{mono|0x10000000}} | ||
| SURF_N64_UV | | SURF_N64_UV | ||
| {{ | | {{code|<small>[[$basetexturetransform]] "center .5 .5 scale 0.5 0.5 rotate 0 translate 0 0"</small>}} | ||
| {{not|Vanilla}} Halves texture sizes, without requiring setting texture scale in the editor to 2.0. | | {{not|Vanilla}} Halves texture sizes, without requiring setting texture scale in the editor to 2.0. | ||
|- | |- | ||
Revision as of 11:24, 30 August 2023
WAL is a texture file format used by
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 1.
Texture flags
These sections list and describe the various standard surface and content flags used in
Quake II, as well as the equivalent VMT parameters to achieve the same result in
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. |
| 0x00000004 | SURF_SKY | %compile2dsky 1
|
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% or 66% opacity, respectively.
Most source ports, including the remaster, will render any texels using palette index 255 (or true color images with an alpha of less than 127) as fully transparent. While these flags can technically be combined, the behavior for such is not standardized. Some engines (such as Yamagi) will prioritize one or the other, others (such as Q2EX) will render the face at 50% opacity, and a small will even render the face with binary transparency. |
| 0x00000020 | SURF_TRANS66 | $alpha "0.66"
| |
| 0x00000040 | SURF_FLOWING | TextureScroll material proxy | Texture scrolls from top to bottom. Requires SURF_WARP. |
| 0x00000080 | SURF_NODRAW | %compilenodraw 1
|
Do not render this face in-game. |
| 0x00000100 | SURF_HINT | %compilehint 1
|
Used on hint brushes. |
| 0x00000200 | SURF_SKIP | %compileskip 1
|
Completely ignore. Causes unexpected results when applied to anything other than hint brushes. |
| 0x02000000 | SURF_ALPHATEST | $alphatest 1
|
(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.
| Bit | Flag name | VMT equivalent | Description |
|---|---|---|---|
| 0x1 | CONTENTS_SOLID | N/A | Default contents. Generally no need to set manually. |
| 0x2 | CONTENTS_WINDOW | N/A | Prevents the renderer from drawing the backfaces of a brush. |
| 0x4 | CONTENTS_AUX | N/A | No effect. Some compilers treat it as an alias for a combination of of CONTENTS_MIST and CONTENTS_WINDOW. |
| 0x8 | CONTENTS_LAVA | %CompileWater 1, along with a trigger_hurt brush
|
Makes brush swimmable. CONTENTS_LAVA and CONTENTS_SLIME also deal periodic damage to the anyone or anything in them, with lava dealing more damage than slime. |
| 0x10 | CONTENTS_SLIME | %CompileSlime 1, along with a trigger_hurt brush
| |
| 0x20 | CONTENTS_WATER | %CompileWater 1
| |
| 0x40 | CONTENTS_MIST | Disables collision, and sometimes disables backface culling. | |
| 0x4000 | CONTENTS_PROJECTILECLIP | N/A | (not in Vanilla) Blocks moving entities using CONTENTS_PROJECTILE. No effect on hitscan weapons. |
| 0x8000 | CONTENTS_AREAPORTAL | N/A | Used on areaportals. |
| 0x10000 | CONTENTS_PLAYERCLIP | %playerclip 1
|
Blocks player and bot movement. |
| 0x20000 | CONTENTS_MONSTERCLIP | %compilenpcclip 1
|
Blocks monster (NPC) movement. |
| 0x40000 | CONTENTS_CURRENT_0 | N/A | Pushes stuff inside it in the specified direction. Can be stacked. |
| 0x80000 | CONTENTS_CURRENT_90 | N/A | |
| 0x100000 | CONTENTS_CURRENT_180 | N/A | |
| 0x200000 | CONTENTS_CURRENT_270 | N/A | |
| 0x400000 | CONTENTS_CURRENT_UP | N/A | |
| 0x800000 | CONTENTS_CURRENT_DOWN | N/A | |
| 0x1000000 | CONTENTS_ORIGIN | %compileorigin 1
|
Sets the origin of brush entities. |
| 0x2000000 | CONTENTS_MONSTER | N/A | Internal flag, do not set. |
| 0x4000000 | CONTENTS_DEADMONSTER | N/A | Internal flag, do not set. |
| 0x8000000 | CONTENTS_DETAIL | %CompileDetail 1
|
Brush does not chop structural brushes, and does not affect VIS. It may, however, still affect visibility. |
| 0x10000000 | CONTENTS_TRANSLUCENT | N/A | Marks brush as able to be seen through. Automatically set by SURF_TRANS33 and SURF_TRANS66, and in some compilers, SURF_ALPHATEST. |
| 0x20000000 | CONTENTS_LADDER | %CompileLadder 1
|
Makes climbable. |
| 0x40000000 | CONTENTS_PLAYER | N/A | (not in Vanilla) Internal flag, do not set. |
| 0x10000000 | CONTENTS_PROJECTILE | N/A | (not in Vanilla) Internal flag, do not set. |