Shadowfaces

Shadow-Casting Faces
World Shadowfaces
    _shadow
BModel Shadowfaces
    _shadow

Related Topics


Shadow-Casting Faces

The main Qrad3 light-tracing formula checks for intersections between light-rays and solid, non-transparent, world brushes. That means things like windows and liquids normally couldn't cast shadows. ArghRad adds the ability to create "shadowfaces" - individual map faces set up to block light. This allows bmodels, transparent faces, and non-solid faces to cast shadows.

To designate a shadowface, set the NODRAW flag on any visible, but normally non-shadow-casting, face. This is possible because NODRAW itself does not actually make faces invisible in the game. Invisibility really depends on the SKY, HINT, SKIP, PLAYERCLIP, MONSTERCLIP or ORIGIN flags.

World Shadowfaces

The actual appearance of shadows cast by world (non-bmodel) shadowfaces is controlled by this setting.


 
 
_shadow  style
_shadow  nontrans trans

location: worldspawn    version: 3.00  
style: 0-3
notrans trans: 0-3 each
default: -
default: 1 3

Defines the appearance of all shadows cast by world shadowfaces. The value can take one of two forms:

style - A single value used by all shadowfaces.

nontrans trans - Two values: the first is used by all non-transparent shadowfaces, the second by all TRANS33 or TRANS66 shadowfaces.

By default, non-transparent faces cast black shadows, and transparent faces project their textures. Use the following values to set the indicated shadow styles:

0  -  No shadows.
1  -  Black shadows.
2  -  Single-color shadows (uses reflectivity color).
3  -  Projects the face's texture.

The TRANS33 surface property makes shadows 33% opaque, while TRANS66 makes them 66%. If the texture has an alpha mask, it will always be projected with the shadow. Alpha depends on the texture format: .TGA & .M32 use their alpha channel, .WAL & .PCX make the last palette color fully transparent.

The original Quake2.exe only renders .WAL palette transparency on TRANS* faces. Several engine-mods offer a workaround: setting both TRANS33 & TRANS66 will render the face fully opaque, but also with palette transparency. ArghRad supports this feature by treating that combination as non-transparent.

no example image example map
 

BModel Shadowfaces

BModel entities provide additional flexibility for shadowfaces. Each entity can have a different setting, allowing many different styles to be used throughout the map.


 
 
_shadow  style
_shadow  nontrans trans

location: bmodel entity    version: 3.00  
style: 0-3
notrans trans: 0-3 each
default: 0
default: 0 0

Defines the appearance of all shadows cast by this BModel's shadowfaces. The value can take one of two forms:

style - A single value used by all shadowfaces.

nontrans trans - Two values: the first is used by all non-transparent shadowfaces, the second by all TRANS33 or TRANS66 shadowfaces.

By default, bmodels do not cast any shadows. Use the following values to set the indicated shadow styles:

0  -  No shadows.
1  -  Black shadows.
2  -  Single-color shadows (uses reflectivity color).
3  -  Projects the face's texture.

The TRANS33 surface property makes shadows 33% opaque, while TRANS66 makes them 66%. If the texture has an alpha mask, it will always be projected with the shadow. Alpha depends on the texture format: .TGA & .M32 use their alpha channel, .WAL & .PCX make the last palette color fully transparent.

The original Quake2.exe only renders .WAL palette transparency on TRANS* faces. Several engine-mods offer a workaround: setting both TRANS33 & TRANS66 will render the face fully opaque, but also with palette transparency. ArghRad supports this feature by treating that combination as non-transparent.

Note: like all lighting, the shadows are static - they will remain in place even if the BModel moves or disappears.

no example image example map
 

Related Topics

-noshadowfilter
-noshadowface