Surfaces

Introduction


Each face of a brush has its own parameters to define the type of surface, the game uses it to play correct sound and effets when walking on/shooting in something. Some special attributes allows the texture to use an alpha parameter (transparency) or project white light. Note that you can also set a specific kind of content using the content flag of each surface (sounds weird, and yes, it is).

Surfaces list


Value, Type, Description
1 light Emit light (a light value must also be set)
2 Slick ?
4 Sky Display the skybox (worldspawn only)
8 Wrap Enable water deformation
16 Trans33 Almost invisible
32 Trans66 Almost opaque
64 Flowing Waterfall effect, Wrap must be enabled
128 NoDraw Don't render, Sky must be enabled (worldspawn )
256 Hint (See the Hint Brush chapter)
512 Skip (See the Hint Brush chapter)
1024 Specular ?
2048 Diffuse ?
4096 Alpha If the texture has an alpha layer, use it to render the surface
8192 Mirror ?
16384 Wndw33 ?
32768 Wndw66 ?
65536 10000 ?
131072 20000 ?
262144 40000 ?
524288 Water This surface is made of water
1048576 Concrete This surface is made of concrete (default)
2097152 Fabric This surface is made of fabric
4194304 Gravel This surface is made of gravel
8388608 Metal This surface is made of metal
16777216 Metal Lite This surface is made of metal
33554432 Tin This surface is made of metal
67108864 Wood This surface is made of wood
134217728 Reflect Fake ?
268435456 Reflect light ?
536870912 40000000 ?
107374182480000000 ?

Contents list


Value, Type, Description
1 Solid Solid (default)
2 Window The brush cannot "close" an area, surfaces back-culling
4 Aux ?
8 Lava Hazardeous liquid
16 Slime Hazardeous liquid
32 Water Liquid
64 Mist Non-solid
128 Fence The brush cannot "close" an area, render both side of each surface
256 100 (See the Hint Brush chapter)
512 200 (See the Hint Brush chapter)
1024 400 ?
2048 800 ?
4096 1000 If the texture has an alpha layer, use it to render the surface
8192 2000 ?
16384 4000 ?
32768 8000 ?
65536 Player Clip Invisible solid surface (clients only)
131072 Monster Clip Invisible solid surface (NPCs only)
262144 current_0 ?
524288 current_90 ?
1048576 current_180 ?
2097152 current_270 ?
4194304 current_up ?
8388608 current_down ?
16777216 origin Used to define the origin of an entity (the rotation axe for example)
33554432 monster ?
67108864 corpse ?
134217728 detail This brush WILL subdivide the BSP surface tree but will NOT affect VIS processing
268435456 translucent This brush is see-through
536870912 Ladder Can be climbed like a ladder
107374182440000000 ?
214748364880000000 ?

See-through elements


When it comes to alpha sorting and transparent surfaces, Kingpin kinda suck. Here are two ways of creating see-through brush.

The easiest way to make a fence is to create a brush and set it's "fence" surface to Alpha and make the whole brush's content Fence, Translucent (hide the extra surfaces with a Sky, NoDraw combination). You should also make it Detail as it's a see-through and shouldn't affect the visibility computing process anyway. This methode is easy but it will increase the amount of triangles required to render the scene wherever the fence is touching another brush. Also, this surface will ALWAYS appear fullbright.

The other possibility you have is to tie this brush to a func_wall entity, carefuly ignoring the surface and content flags, open the entity box and set its spawnflag 32 (SURF2_ALPHA). Entities are never used for the vis processing and will not create extra polygons while rendering the scene (because these objects are not static like the worldspawn). Note that colored lights will also be correctly applied to the entity! However, you can't use Sky, NoDraw surfaces on a brush-entity and Kingpin will NOT sort transparent surfaces while rendering the scene because every entity is rendered in the same order as they've been created.

You can cheat a bit with the second method, creating multiple entities for each face, carefuly ordering the entity's and surface creation to emulate what the engine should do, but it's actually not worth the time. I'd advise you to use the second method in dark areas and when there are no other transparent surfaces to render.