Texture shadows: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 7: Line 7:
{{only|{{slammin}}}} To enable brush and displacement texture shadows, add {{code|-worldtextureshadows}} (and optionally {{code|-translucentshadows}} for translucent shadows) to the [[VRAD]] parameters.
{{only|{{slammin}}}} To enable brush and displacement texture shadows, add {{code|-worldtextureshadows}} (and optionally {{code|-translucentshadows}} for translucent shadows) to the [[VRAD]] parameters.
{{Bug|{{slammin}} {{code|-worldtextureshadows}} and {{code|-translucentshadows}} are non-functional.|tested=newer versions of {{slammin}} VRAD}}
{{Bug|{{slammin}} {{code|-worldtextureshadows}} and {{code|-translucentshadows}} are non-functional.|tested=newer versions of {{slammin}} VRAD}}
{{modernImportant|Only the alpha channels of the textures are used for shadow casting calculations. For example, stained glass windows using the {{ent|Refract}} shader will be treated as opaque, as will materials using {{cmd|$additive}} without {{cmd|translucent}}.}}
{{modernImportant|Only the alpha channels of the textures are used for shadow casting calculations. For example, stained glass windows using the {{ent|Refract}} shader will be treated as opaque, as will materials using {{cmd|$additive}} without {{cmd|$translucent}}.}}
{{bug|VRAD is unable to calculate texture shadows for textures using DXT3 compression. Use DXT5 instead.|tested={{hl2dm}}}}
{{bug|VRAD is unable to calculate texture shadows for textures using DXT3 compression. Use DXT5 instead.|tested={{hl2dm}}}}



Revision as of 05:31, 21 January 2025

Texture shadows in Portal 2

Texture shadows allow transparent model surfaces (not brushes or displacements!) to cast baked lightmap shadows.

To enable model texture shadows, add -TextureShadows to the VRAD parameters.

(only in Slammin' Source Map Tools) To enable brush and displacement texture shadows, add -worldtextureshadows (and optionally -translucentshadows for translucent shadows) to the VRAD parameters.

Icon-Bug.pngBug:Slammin' Source Map Tools -worldtextureshadows and -translucentshadows are non-functional.  (tested in: newer versions of Slammin' Source Map Tools VRAD)
Icon-Important.pngImportant:Only the alpha channels of the textures are used for shadow casting calculations. For example, stained glass windows using the Refract shader will be treated as opaque, as will materials using $additive without $translucent.
Icon-Bug.pngBug:VRAD is unable to calculate texture shadows for textures using DXT3 compression. Use DXT5 instead.  (tested in: Half-Life 2: Deathmatch)

Models

In QC

Add $casttextureshadows to the model's QC file to enable texture shadows.

Example:

$modelname "props_grate/metal_grate_64.mdl"
$model body "metal_grate_64.smd"
$staticprop

$cdmaterials "metal/"

$surfaceprop "metal"
$contents "grate"

$casttextureshadows

lights.rad

Texture shadows can be enabled on any prop without editing and recompiling the QC through the RAD file.

Example

forcetextureshadow props_underground/walkway_128a.mdl
forcetextureshadow props_underground/walkway_128b.mdl