Texture shadows: Difference between revisions
Jump to navigation
Jump to search
Important: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
SirYodaJedi (talk | contribs) mNo edit summary |
SirYodaJedi (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
[[File:Textureshadows portal2.jpg|thumb|right|Texture shadows in Portal 2]] | [[File:Textureshadows portal2.jpg|thumb|right|Texture shadows in Portal 2]] | ||
Texture shadows | Texture shadows [[model]] surfaces (not brushes or displacements!) to cast baked lightmap shadows based upon transparency or translucency from {{cmd|$alphatest}} or {{cmd|$translucent}}. | ||
To enable model texture shadows, add {{code|-TextureShadows}} to the [[VRAD]] parameters. | To enable model texture shadows, add {{code|-TextureShadows}} to the [[VRAD]] parameters. | ||
Revision as of 05:37, 21 January 2025
Texture shadows model surfaces (not brushes or displacements!) to cast baked lightmap shadows based upon transparency or translucency from $alphatest or $translucent.
To enable model texture shadows, add -TextureShadows to the VRAD parameters.
(only in
) To enable brush and displacement texture shadows, add -worldtextureshadows (and optionally -translucentshadows for translucent shadows) to the VRAD parameters.
$additive without $translucent.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