Texture shadows: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (update to 2024 info)
Line 3: Line 3:
Texture shadows allow transparent [[model]] surfaces (not brushes or displacements!) to cast baked lightmap shadows.
Texture shadows allow transparent [[model]] surfaces (not brushes or displacements!) to cast baked lightmap shadows.


To enable texture shadows, add <code>[[#Effects|-TextureShadows]]</code> to the VRAD parameters.
To enable model texture shadows, add {{code|-TextureShadows}} to the [[VRAD]] parameters.
 


{{only|{{slammin}}}} To enable brush and displacement texture shadows, add {{code|-worldtextureshadows}} to the [[VRAD]] parameters.


== Models ==
== Models ==


=== In QC ===
=== In QC ===
Add <code>$casttextureshadows</code> to the model's QC file to enable texture shadows.
Add {{code|$casttextureshadows}} to the model's QC file to enable texture shadows.


Example:
Example:
Line 27: Line 27:


=== lights.rad ===
=== lights.rad ===
Textureshadows can be enabled on any prop without editing and recompiling the QC through the [[VRAD#Lights_files|lights.rad]] file
Texture shadows can be enabled on any prop without editing and recompiling the QC through the [[RAD file]].


Example
Example

Revision as of 11:45, 24 January 2024

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 to the VRAD parameters.

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