WAL: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Content flags: add table)
mNo edit summary
Line 24: Line 24:
| {{mono|0x00000004}}
| {{mono|0x00000004}}
| SURF_SKY
| SURF_SKY
| {{codeblock|1=[[%compile2dsky]] 1}}
| {{code|1=[[%compile2dsky]] 1}}
| Face is is not drawn, and the [[skybox]] is drawn behind all visible faces when this face is in the [[PVS]].
| Face is is not drawn, and the [[skybox]] is drawn behind all visible faces when this face is in the [[PVS]].
|-
|-
Line 34: Line 34:
| {{mono|0x00000010}}
| {{mono|0x00000010}}
| SURF_TRANS33
| SURF_TRANS33
| {{codeblock|[[$alpha]] "0.33"}}
| {{code|[[$alpha]] "0.33"}}
| Render the face as translucent, at 33% opacity.
| 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.
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.
Line 40: Line 40:
| {{mono|0x00000020}}
| {{mono|0x00000020}}
| SURF_TRANS66
| SURF_TRANS66
| {{codeblock|[[$alpha]] "0.66"}}
| {{code|[[$alpha]] "0.66"}}
| Render the face as translucent, at 66% opacity.
| 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.
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.
Line 51: Line 51:
| {{mono|0x00000080}}
| {{mono|0x00000080}}
| SURF_NODRAW
| SURF_NODRAW
| {{codeblock|1=[[%compilenodraw]] 1}}
| {{code|1=[[%compilenodraw]] 1}}
| Do not render this face in-game.
| Do not render this face in-game.
|-
|-
| {{mono|0x00000100}}
| {{mono|0x00000100}}
| SURF_HINT
| SURF_HINT
| {{codeblock|1=[[%compilehint]] 1}}
| {{code|1=[[%compilehint]] 1}}
| Used on [[hint brush]]es.
| Used on [[hint brush]]es.
|-
|-
| {{mono|0x00000200}}
| {{mono|0x00000200}}
| SURF_SKIP
| SURF_SKIP
| {{codeblock|1=[[%compileskip]] 1}}
| {{code|1=[[%compileskip]] 1}}
| Completely ignore. Causes unexpected results when applied to anything other than hint brushes.
| Completely ignore. Causes unexpected results when applied to anything other than hint brushes.
|-
|-
| {{mono|0x02000000}}
| {{mono|0x02000000}}
| SURF_ALPHATEST
| SURF_ALPHATEST
| {{codeblock|[[$alphatest]] 1}}
| {{code|[[$alphatest]] 1}}
| {{not|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.
| {{not|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.
|-
|-
Line 114: Line 114:
| 0x8
| 0x8
| CONTENTS_LAVA
| CONTENTS_LAVA
| {{codeblock|[[%CompileWater]] 1}}, along with a {{ent|trigger_hurt}} brush
| {{code|[[%CompileWater]] 1}}, along with a {{ent|trigger_hurt}} brush
|  
| rowspan=3 | 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
| 0x10
| CONTENTS_SLIME
| CONTENTS_SLIME
| {{codeblock|[[%CompileSlime]] 1}}, along with a {{ent|trigger_hurt}} brush
| {{code|[[%CompileSlime]] 1}}, along with a {{ent|trigger_hurt}} brush
|
|-
|-
| 0x20
| 0x20
| CONTENTS_WATER
| CONTENTS_WATER
| {{codeblock|[[%CompileWater]] 1}}
| {{code|[[%CompileWater]] 1}}
|
|-
|-
| 0x40
| 0x40
Line 144: Line 142:
| 0x10000
| 0x10000
| CONTENTS_PLAYERCLIP
| CONTENTS_PLAYERCLIP
| {{codeblock|%playerclip 1}}
| {{code|%playerclip 1}}
|  
| Blocks player and bot movement.
|-
|-
| 0x20000
| 0x20000
| CONTENTS_MONSTERCLIP
| CONTENTS_MONSTERCLIP
| {{codeblock|%compilenpcclip 1}}
| {{code|%compilenpcclip 1}}
|  
| Blocks [[monster]] (NPC) movement.
|-
|-
| 0x40000
| 0x40000
Line 179: Line 177:
| 0x1000000
| 0x1000000
| CONTENTS_ORIGIN
| CONTENTS_ORIGIN
| {{codeblock|%compileorigin 1}}
| {{code|%compileorigin 1}}
|  
|  
|-
|-
Line 185: Line 183:
| CONTENTS_MONSTER
| CONTENTS_MONSTER
| N/A
| N/A
|  
| Internal flag, do not set.
|-
|-
| 0x4000000
| 0x4000000
| CONTENTS_DEADMONSTER
| CONTENTS_DEADMONSTER
| N/A
| N/A
|  
| Internal flag, do not set.
|-
|-
| 0x8000000
| 0x8000000
| CONTENTS_DETAIL
| CONTENTS_DETAIL
| {{codeblock|[[%CompileDetail]] 1}}
| {{code|[[%CompileDetail]] 1}}
|  
| Brush does not chop structural brushes, and does not affect [[VIS]]. It may, however, still affect [[visibility]].
|-
|-
| 0x10000000
| 0x10000000
| CONTENTS_TRANSLUCENT
| CONTENTS_TRANSLUCENT
| N/A
| 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
| 0x20000000
| CONTENTS_LADDER
| CONTENTS_LADDER
| {{codeblock|[[%CompileLadder]] 1}}
| {{code|[[%CompileLadder]] 1}}
|  
| Makes climbable.
|-
|-
| 0x40000000
| 0x40000000
| CONTENTS_PLAYER
| CONTENTS_PLAYER
| N/A
| N/A
| {{not|Vanilla}}
| {{not|Vanilla}} Internal flag, do not set.
|-
|-
| 0x10000000
| 0x10000000
| CONTENTS_PROJECTILE
| CONTENTS_PROJECTILE
| N/A
| N/A
| {{not|Vanilla}}
| {{not|Vanilla}} Internal flag, do not set.
|-
|-
|}
|}

Revision as of 11:56, 30 August 2023

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 %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% 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 %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
0x2 CONTENTS_WINDOW N/A Prevents the renderer from drawing the backfaces of a brush.
0x4 CONTENTS_AUX N/A Alternative to CONTENTS_MIST that always has backface culling.
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)
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
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.