Difference between revisions of "VRAD"

From Valve Developer Community
Jump to: navigation, search
(Lights files)
(Updated lights.rad section to indicate that it will place lights at each luxel)
 
(81 intermediate revisions by 37 users not shown)
Line 1: Line 1:
 +
{{otherlang2
 +
|zh-cn = Vrad:zh-cn
 +
|ru = VRAD:ru}}
 
{{toc-right}}
 
{{toc-right}}
  
'''VRAD''' is the [[command-line]] tool that compiles a map's [[lightmap]]s and per-leaf ambient lighting. It gives parts of the map, called patches, a certain amount of brightness depending on how much light it calculates it should receive.
+
'''VRAD''' is the [[command-line]] tool that takes a compiled BSP map and embeds lighting data into it. VRAD's static and pre-compiled light is bounced around the world with a [[Wikipedia:Radiosity (3D computer graphics)|radiosity]] algorithm.
  
==Speed==
+
VRAD will:
  
VRAD is the generally the slowest of the three compilers due to the many, many calculations it must perform. [[Optimization (level design)|Map optimization]] can reduce the speed of this tool somewhat, especially reducing the number of unique names given to lights (which reduces the number of dynamic light combinations for which radiosity must be calculated).
+
* Generate [[lightmap]]s
 +
* Generate [[Ambient light|ambient samples]]
 +
* Generate per-object or per-vertex [[prop_static]] and [[detail prop]] lighting
  
If you are watching the compile dialog and it looks like it has hung at ''<code>9...</code>'' this is usually because Vrad takes longer with each light bounce calculation. Be patient.
+
VRAD is generally the slowest of the three compilers due to the many, many calculations it must perform. [[Lighting optimization]] can help, as can ensuring your map is free of [[leak]]s.
 +
 
 +
{{tip|If you are watching the compile dialog and it looks like it has hung at ''<code>9...</code>'' this is usually because VRAD takes longer with each light bounce calculation.}}
 +
{{warning|VRAD will take up a lot of CPU during conversion of trying to make light.}}
 +
 
 +
{{bug|Ep1 and L4D users seeing crashes when VRAD compiles HDR lighting should read [[VRAD HDR Crash Fix]].}}
 +
 
 +
{{bug|In non-L4D branch games, <code>.mdl</code> files that don't have <code>.dx80.vtx</code> files with them will lead to VRAD skipping lighting for that prop. Copying the <code>.dx90.vtx</code> file and renaming it to a <code>.dx80.vtx</code> will fix the issue.}}
 +
A windows batch file to do this automatically has been created here: [https://drive.google.com/file/d/1OlQcFDlJPbK5vp6PTv7CZGXBjF9Z1UU0/view?usp=sharing] (place above model folder and run .bat)
 +
{{bug|Additionally, <code>.mdl</code> files that have the <code>IDST1</code> header will fail to load for [[VBSP]], and will give a error message stating the prop failed to load; this can be fixed by changing the header to <code>IDST0</code> in a Hex Editor, or by recompiling the prop in a non-L4D branch [[Studiomdl]] application such as Source 2013.}}
 +
{{bug|As of around 5-10 years ago up until at least October, 2017 all known copies of VRAD have a thread sharing bug which causes performance to scale poorly to multiple threads, particularly on outdoor scenes with -final set (despite showing 100% CPU usage). The fix to this bug for Source 2013 is available [https://github.com/ValveSoftware/source-sdk-2013/pull/436 here] and edited DLLs are available [http://www.content.tophattwaffle.com/Content/modded_vrad_dll.zip here]. Valve also released a patch for CSGO's VRAD that fixes this issue.}}
 +
{{bug|Randomly causes corrupt lightmaps that look like "ink spills".}}
 +
: {{tip| [https://github.com/Enderlux/sourcelightmap Source Engine BSP Lightmap Editor] can be used to manually correct a .bsp lightmap data.}}
 +
 
 +
== Syntax ==
 +
 
 +
vrad [options...] <bsp file>
 +
 
 +
For example:
 +
 
 +
"Half-Life 2\bin\vrad.exe" -both -StaticPropLighting sdk_trainstation_01
 +
 
 +
This will generate and embed both standard and [[HDR|High Dynamic Range]] lighting data, at per-vertex detail for prop_static entities.
  
 
==Options==
 
==Options==
Use these in combination with [[expert compile mode]] or a batch file:
+
 
 +
Use these in combination with [[expert compile mode]] or a batch file.
  
 
=== Effects ===
 
=== Effects ===
  
;<code>-both</code>
+
{{ColumnBox|count=2|
:Compiles lightmaps for both Low Dynamic Range and [[HDR|High Dynamic Range]] lighting models. Causes the compiler to run twice.
+
; <code>-ldr</code>
;<code>-ldr</code>
+
; <code>-hdr</code>
:Compile only LDR lightmaps.
+
; <code>-both</code>
;<code>-hdr</code>
+
: Whether to compile standard or [[HDR|High Dynamic Range]] lighting, or both.
:Compile only HDR lightmaps.
+
: {{note|In {{insurgency}}{{csgo}}, you MUST compile with -hdr in order have proper lighting, as LDR isn't supported.}}
 
;<code>-fast</code>
 
;<code>-fast</code>
: Quick and dirty lighting. Has been known to leave dark lines around displacements.
+
: Quick and dirty lighting. Don't ship with this.
 
;<code>-final</code>
 
;<code>-final</code>
 
: Increases the quality of [[light_environment]] and indirect lighting by spending more time firing rays.
 
: Increases the quality of [[light_environment]] and indirect lighting by spending more time firing rays.
;<code>-lights <file></code>
+
;<code>-extrasky <[[int]]></code>
:Load a custom [[#Lights_files|lights file]] in addition to <code>lights.rad</code> and map-specific lights file. The file specified must be <code><filename>.rad</code>.
+
: Trace N times as many rays for indirect light and sky ambient. {{clr}}(-final is equivalent to -extrasky 16; normal is equivalent to -extrasky 1)
;<code>-bounce #</code>
+
;<code>-lights <filename>.rad</code>
: Set the maximum number of light ray bounces (default: 10).
+
:Load a custom [[#Lights_files|lights file]] in addition to <code>lights.rad</code> and map-specific lights file. Include the file extension in the parameter.
;<code>-smooth #</code>
+
;<code>-bounce <[[int]]></code>
 +
: Set the maximum number of light ray bounces (default: 100).
 +
;<code>-smooth <[[int]]></code>
 
:Set the threshold for [[smoothing group]]s, in degrees (default: 45).
 
:Set the threshold for [[smoothing group]]s, in degrees (default: 45).
;<code>-luxeldensity #</code>
+
;<code>-luxeldensity <[[normal]]></code>
 
:Scale down all luxels. Default (and maximum) value is 1.
 
:Scale down all luxels. Default (and maximum) value is 1.
;<code>-softsun <n></code>
+
;<code>-softsun <[[float]]></code>
:Treat the sun as an area light source of size <n> degrees. Produces soft shadows. Recommended values are between 0 and 5. Default is 0.
+
:Treat the sun as an area light source of this many degrees. Produces soft shadows. Recommended values are 0-5, default is 0. Identical to the SunSpreadAngle parameter in [[light_environment]].
 +
 
 +
 
 
;<code>-StaticPropLighting</code>
 
;<code>-StaticPropLighting</code>
:Generate per-vertex <code>[[prop_static]]</code> lighting. This is always enabled for [[light_spot]] entities.
+
:Generate per-vertex [[prop_static]] lighting; always enabled for [[light_spot]] entities. Disables [[info_lighting]] entities on props WITHOUT normal maps. Does not work on props with <code>[[$phong]]</code> enabled, except in {{csgo}}.
 +
:{{note|In {{csgo}}, in order to get proper lighting on your static props, you will need to run VRAD with this command.}}
 +
:{{Warning|This can increase your map's filesize substantially. Disable vertex lighting for props that don't need it to keep filesize low.}}
 
;{{EP2 add|<code>-StaticPropPolys</code>}}
 
;{{EP2 add|<code>-StaticPropPolys</code>}}
:Perform shadow tests of <code>prop_static</code>s at polygon precision. ''('''Very''' processor-intensive - default is to use collision models.)''
+
:Perform shadow tests of <code>prop_static</code>s at polygon precision. Default is to use [[collision mesh]]es.
 
;{{EP2 add|<code>-TextureShadows</code>}}
 
;{{EP2 add|<code>-TextureShadows</code>}}
:Generates lightmap shadows from [[$translucent]] surfaces of models that are specified in a [[#Lights_files|lights file]] and being used with [[prop_static]]. Usually requires <code>-StaticPropPolys</code> to have any effect.
+
:Generates lightmap shadows from [[$translucent]] surfaces of models (NOT brushes) that are specified in a [[#Lights_files|lights file]] and being used with [[prop_static]]. Usually requires <code>-StaticPropPolys</code> to have any effect.
 
:{{note|A surface will need a low [[lightmap]] scale for most texture shadows to be recognisable.}}
 
:{{note|A surface will need a low [[lightmap]] scale for most texture shadows to be recognisable.}}
 +
:{{note|For some strange reason this will not work if a translucent texture's VMT file contains the .vtf file ending in the basetexture lines.}}
 +
;{{CSGO add|<code>-aoscale <[[float]]></code>}}
 +
:Scales the intensity of VRAD's simulated ambient occlusion. 1.0 is default.
 +
:{{Tip|Valve uses 1.5 for the new Dust 2.}}
 +
;{{Ins only|<code>-aoradius <[[float]]></code>}}
 +
:Set the radius of VRAD's simulated ambient occlusion. {{TODO|Figure out what exactly this does.}}
 +
;{{Ins only|<code>-aosamples <[[int]]></code>}}
 +
:How many samples to use for VRAD's simulated ambient occlusion.
 +
;{{CSGO add|<code>-StaticPropBounce <[[int]]></code>}}
 +
:Number of static prop light bounces to simulate. The default is 0.
 +
:{{Tip|Valve uses 3 static prop bounces for the new Dust 2.}}
 +
:{{Note|Any static props that you want light to bounce off of must also have their "Enable Bounced Lighting" keyvalue set.}}
 +
;{{CSGO add|<code>-StaticPropLightingFinal</code>}}
 +
:Compiles high quality lighting for static props.
 +
;{{CSGO add|<code>-StaticPropLightingOld</code>}}
 +
:Will use old algorithm on props, light affects them much more.
 +
}}
  
 
=== Performance ===
 
=== Performance ===
  
 +
{{ColumnBox|count=2|
 
;<code>-low</code>
 
;<code>-low</code>
:Run as an low-priority process. Allows you to use your computer for other things during compiles.
+
:Run as a low-priority process.
;<code>-threads</code>
+
;<code>-threads <[[int]]></code>
:Control the number of threads used (defaults to the number of processors on your machine, doubled for CPUs with hyperthreading).
+
:Override the number of CPU threads used. Maximum is 16 threads. With a [[Increased_Thread_Limit_for_Compile_Tools|patched vrad_dll]] you can use 32 threads.  
 
;<code>-mpi</code>
 
;<code>-mpi</code>
 
:Use [[Vmpi|VMPI]] to distribute computations.
 
:Use [[Vmpi|VMPI]] to distribute computations.
;<code>-mpi_pw <pw></code>
+
;<code>-mpi_pw <[[string]]></code>
 
:Use a password to choose a specific set of VMPI workers.
 
:Use a password to choose a specific set of VMPI workers.
 
;<code>-noextra</code>
 
;<code>-noextra</code>
 
:Disable supersampling.
 
:Disable supersampling.
;<code>-chop</code>
+
;<code>-chop <int></code>
:Smallest number of [[luxel]] widths for a bounce patch, used on edges.
+
:Smallest number of [[luxel]] widths for a bounce patch, used on edges. (Default: 4)
;<code>-maxchop</code>
+
;<code>-maxchop <int></code>
:Coarsest allowed number of luxel widths for a patch, used in face interiors.
+
:Coarsest allowed number of luxel widths for a patch, used in face interiors. (Default: 4)
 +
;<code>-dispchop <int></code>
 +
:Smallest acceptable [[luxel]] width of displacement patch face. (Default: 8)
 
;<code>-LargeDispSampleRadius</code>
 
;<code>-LargeDispSampleRadius</code>
 
:This can be used if there are splotches of bounced light on terrain. The compile will take longer, but it will gather light across a wider area.
 
:This can be used if there are splotches of bounced light on terrain. The compile will take longer, but it will gather light across a wider area.
;<code>-compressconstant <n></code>
+
;<code>-compressconstant <int></code>
:Compress [[lightmap]]s whose color variation is less than n units.
+
:Compress [[lightmap]]s whose color variation is less than this many units.
 +
;<code>-fastambient</code>
 +
:Uses low quality per-leaf ambient sampling to save compute time.
 +
;{{ins only|<code>-noao</code>}}
 +
:Disables compiling simulated ambient occlusion for lightmaps.
 +
;{{CSGO add|<code>-StaticPropSampleScale x</code>}}
 +
:Regulates the generated per-vertex prop_static lighting.
 +
:slow: 16 (high quality); default: 4 (normal); fast: 0.25 (low quality)
 +
:{{note|-final is the equivalent of having -StaticPropLightingScale 16.}}
 +
}}
  
 
=== Debugging ===
 
=== Debugging ===
  
;<code>-rederror</code>
+
{{ColumnBox|count=2|
:Emit bright red light from error locations?
+
;<code>-rederrors</code>
 +
:Emit red light when "a luxel has no samples".
 
;<code>-vproject <directory></code>
 
;<code>-vproject <directory></code>
 
;<code>-game <directory></code>
 
;<code>-game <directory></code>
 
:Override the VPROJECT environment variable.
 
:Override the VPROJECT environment variable.
;<code>v</code>
+
;<code>-insert_search_path <directory></code>
 +
:{{Todo|What does this do?}}
 +
;<code>-v</code>
 
;<code>-verbose</code>
 
;<code>-verbose</code>
 
: Turn on verbose output.
 
: Turn on verbose output.
Line 76: Line 142:
 
:Don't bring up graphical UI on vproject errors.
 
:Don't bring up graphical UI on vproject errors.
 
;<code>-dump</code>
 
;<code>-dump</code>
:Write debugging .txt files.
+
:Dump patches to debug files.
 
;<code>-dumpnormals</code>
 
;<code>-dumpnormals</code>
:Write normals to debug files.
+
:Write normals to debug .txt files.
 
;<code>-debugextra</code>
 
;<code>-debugextra</code>
 
:Places debugging data in lightmaps to visualize supersampling.
 
:Places debugging data in lightmaps to visualize supersampling.
Line 98: Line 164:
 
:Write large minidumps on crash.
 
:Write large minidumps on crash.
 
;<code>-OnlyStaticProps</code>
 
;<code>-OnlyStaticProps</code>
:Only perform direct static prop lighting (vrad debug option)
+
:Only perform direct static prop lighting.
 
;<code>-StaticPropNormals</code>
 
;<code>-StaticPropNormals</code>
:When lighting static props, just show their normal vector
+
:When lighting static props, just show their normal vector.
 +
;<code>-noskyboxrecurse</code>
 +
:Turn off recursion into 3d skybox (skybox shadows on world).
 +
;<code>-nossprops</code>
 +
:Globally disable self-shadowing on static props.
 +
;{{2013 add|<code>-dumppropmaps</code>}}
 +
:Dump computed prop lightmaps.
 +
 
 +
}}
  
 
==Lights files==
 
==Lights files==
Line 108: Line 182:
 
There are:
 
There are:
  
#'''<code>light.rad</code>''', the global file.
+
#'''<code>lights.rad</code>''', the global file.
#'''An auto-loaded map light file'''. It is unclear what filename is needed - perhaps simply <code><map name>.rad</code>?
+
#'''An auto-loaded map light file''', using the format <code><map name>.rad</code>. The file must be placed in the same folder as <code><map name>.vmf</code>.
 
#'''Any number of additional lights files''' that can be added with [[#Effects|the <code>-lights</code> parameter]].
 
#'''Any number of additional lights files''' that can be added with [[#Effects|the <code>-lights</code> parameter]].
  
Line 118: Line 192:
 
;<code><material> <red> <green> <blue> <intensity> <hdr_red> <hdr_green> <hdr_blue> <hdr_intensity></code>
 
;<code><material> <red> <green> <blue> <intensity> <hdr_red> <hdr_green> <hdr_blue> <hdr_intensity></code>
 
:Makes the material emit the given light value when applied to a [[brush]] face (<code>hdr_</code> values are optional). Texture scale has an effect on final intensity. {{note|materials that aren't in a folder must have a slash before their name.}}
 
:Makes the material emit the given light value when applied to a [[brush]] face (<code>hdr_</code> values are optional). Texture scale has an effect on final intensity. {{note|materials that aren't in a folder must have a slash before their name.}}
 +
{{note|This doesn't truly make the material itself emit light, it will actually just place a light entity at each luxel of any face using this material.}}
 +
{{warning|A [[func_detail]] with an emissive material applied on a face may randomly cause VRAD to fail computing lighting for the face.}}
 
;<code>noshadow <material name></code>
 
;<code>noshadow <material name></code>
 
:Prevents the named material from casting shadows.
 
:Prevents the named material from casting shadows.
;<code>forcetextureshadow <model name>.mdl</code>
+
;<code>forcetextureshadow <model path>.mdl</code>
:Enables translucency shadow testing for a model when VRAD is run with <code>[[#Effects|-TextureShadows]]</code>.
+
:Enables translucency shadow testing for a model when VRAD is run with <code>[[#Effects|-TextureShadows]]</code>. Path is relative to the models folder.
 
;<code><nowiki>ldr:</nowiki></code>
 
;<code><nowiki>ldr:</nowiki></code>
 
;<code><nowiki>hdr:</nowiki></code>
 
;<code><nowiki>hdr:</nowiki></code>
 
:Prefixes to make any rule only apply to LDR or HDR lighting.
 
:Prefixes to make any rule only apply to LDR or HDR lighting.
 +
;<code><nowiki>hdr:ldr:</nowiki></code>
 +
:Lines beginning with both tags (in that order) will always be ignored by VRAD. Can be used to add comments or quickly disable some entries.
  
 
==See also ==
 
==See also ==
 
* [[Map Compiling Theory]]
 
* [[Map Compiling Theory]]
 
* [[HDR Lighting Basics]]
 
* [[HDR Lighting Basics]]
* [[Vbsp|VBSP]]
+
* [[VRAD HDR Crash Fix]]
* [[Vvis|VVIS]]
+
* [[Static Props show up black]]
 +
 
 +
{{SDKTools}}
  
[[Category:Tools]]
 
 
[[Category:Level Design]]
 
[[Category:Level Design]]
 
[[Category:Glossary]]
 
[[Category:Glossary]]

Latest revision as of 07:45, 24 November 2019

Русский 简体中文

VRAD is the command-line tool that takes a compiled BSP map and embeds lighting data into it. VRAD's static and pre-compiled light is bounced around the world with a radiosity algorithm.

VRAD will:

VRAD is generally the slowest of the three compilers due to the many, many calculations it must perform. Lighting optimization can help, as can ensuring your map is free of leaks.

Tip:If you are watching the compile dialog and it looks like it has hung at 9... this is usually because VRAD takes longer with each light bounce calculation.

Warning: VRAD will take up a lot of CPU during conversion of trying to make light.

Bug: Ep1 and L4D users seeing crashes when VRAD compiles HDR lighting should read VRAD HDR Crash Fix.
Bug: In non-L4D branch games, .mdl files that don't have .dx80.vtx files with them will lead to VRAD skipping lighting for that prop. Copying the .dx90.vtx file and renaming it to a .dx80.vtx will fix the issue.

A windows batch file to do this automatically has been created here: [1] (place above model folder and run .bat)

Bug: Additionally, .mdl files that have the IDST1 header will fail to load for VBSP, and will give a error message stating the prop failed to load; this can be fixed by changing the header to IDST0 in a Hex Editor, or by recompiling the prop in a non-L4D branch Studiomdl application such as Source 2013.
Bug: As of around 5-10 years ago up until at least October, 2017 all known copies of VRAD have a thread sharing bug which causes performance to scale poorly to multiple threads, particularly on outdoor scenes with -final set (despite showing 100% CPU usage). The fix to this bug for Source 2013 is available here and edited DLLs are available here. Valve also released a patch for CSGO's VRAD that fixes this issue.
Bug: Randomly causes corrupt lightmaps that look like "ink spills".
Tip: Source Engine BSP Lightmap Editor can be used to manually correct a .bsp lightmap data.

Syntax

vrad [options...] <bsp file>

For example:

"Half-Life 2\bin\vrad.exe" -both -StaticPropLighting sdk_trainstation_01

This will generate and embed both standard and High Dynamic Range lighting data, at per-vertex detail for prop_static entities.

Options

Use these in combination with expert compile mode or a batch file.

Effects

-ldr
-hdr
-both
Whether to compile standard or High Dynamic Range lighting, or both.
Note:In <Insurgency><Counter-Strike: Global Offensive>, you MUST compile with -hdr in order have proper lighting, as LDR isn't supported.
-fast
Quick and dirty lighting. Don't ship with this.
-final
Increases the quality of light_environment and indirect lighting by spending more time firing rays.
-extrasky <int>
Trace N times as many rays for indirect light and sky ambient.
(-final is equivalent to -extrasky 16; normal is equivalent to -extrasky 1)
-lights <filename>.rad
Load a custom lights file in addition to lights.rad and map-specific lights file. Include the file extension in the parameter.
-bounce <int>
Set the maximum number of light ray bounces (default: 100).
-smooth <int>
Set the threshold for smoothing groups, in degrees (default: 45).
-luxeldensity <normal>
Scale down all luxels. Default (and maximum) value is 1.
-softsun <float>
Treat the sun as an area light source of this many degrees. Produces soft shadows. Recommended values are 0-5, default is 0. Identical to the SunSpreadAngle parameter in light_environment.


-StaticPropLighting
Generate per-vertex prop_static lighting; always enabled for light_spot entities. Disables info_lighting entities on props WITHOUT normal maps. Does not work on props with $phong enabled, except in <Counter-Strike: Global Offensive>.
Note:In <Counter-Strike: Global Offensive>, in order to get proper lighting on your static props, you will need to run VRAD with this command.
Warning: This can increase your map's filesize substantially. Disable vertex lighting for props that don't need it to keep filesize low.
-StaticPropPolys (New with Half-Life 2: Episode Two / Source 2007)
Perform shadow tests of prop_statics at polygon precision. Default is to use collision meshes.
-TextureShadows (New with Half-Life 2: Episode Two / Source 2007)
Generates lightmap shadows from $translucent surfaces of models (NOT brushes) that are specified in a lights file and being used with prop_static. Usually requires -StaticPropPolys to have any effect.
Note:A surface will need a low lightmap scale for most texture shadows to be recognisable.
Note:For some strange reason this will not work if a translucent texture's VMT file contains the .vtf file ending in the basetexture lines.
-aoscale <float> (New with Counter-Strike: Global Offensive)
Scales the intensity of VRAD's simulated ambient occlusion. 1.0 is default.
Tip:Valve uses 1.5 for the new Dust 2.
-aoradius <float> (Only in Insurgency)
Set the radius of VRAD's simulated ambient occlusion. To do: Figure out what exactly this does.
-aosamples <int> (Only in Insurgency)
How many samples to use for VRAD's simulated ambient occlusion.
-StaticPropBounce <int> (New with Counter-Strike: Global Offensive)
Number of static prop light bounces to simulate. The default is 0.
Tip:Valve uses 3 static prop bounces for the new Dust 2.
Note:Any static props that you want light to bounce off of must also have their "Enable Bounced Lighting" keyvalue set.
-StaticPropLightingFinal (New with Counter-Strike: Global Offensive)
Compiles high quality lighting for static props.
-StaticPropLightingOld (New with Counter-Strike: Global Offensive)
Will use old algorithm on props, light affects them much more.

Performance

-low
Run as a low-priority process.
-threads <int>
Override the number of CPU threads used. Maximum is 16 threads. With a patched vrad_dll you can use 32 threads.
-mpi
Use VMPI to distribute computations.
-mpi_pw <string>
Use a password to choose a specific set of VMPI workers.
-noextra
Disable supersampling.
-chop <int>
Smallest number of luxel widths for a bounce patch, used on edges. (Default: 4)
-maxchop <int>
Coarsest allowed number of luxel widths for a patch, used in face interiors. (Default: 4)
-dispchop <int>
Smallest acceptable luxel width of displacement patch face. (Default: 8)
-LargeDispSampleRadius
This can be used if there are splotches of bounced light on terrain. The compile will take longer, but it will gather light across a wider area.
-compressconstant <int>
Compress lightmaps whose color variation is less than this many units.
-fastambient
Uses low quality per-leaf ambient sampling to save compute time.
-noao (Only in Insurgency)
Disables compiling simulated ambient occlusion for lightmaps.
-StaticPropSampleScale x (New with Counter-Strike: Global Offensive)
Regulates the generated per-vertex prop_static lighting.
slow: 16 (high quality); default: 4 (normal); fast: 0.25 (low quality)
Note:-final is the equivalent of having -StaticPropLightingScale 16.

Debugging

-rederrors
Emit red light when "a luxel has no samples".
-vproject <directory>
-game <directory>
Override the VPROJECT environment variable.
-insert_search_path <directory>
To do: What does this do?
-v
-verbose
Turn on verbose output.
-novconfig
Don't bring up graphical UI on vproject errors.
-dump
Dump patches to debug files.
-dumpnormals
Write normals to debug .txt files.
-debugextra
Places debugging data in lightmaps to visualize supersampling.
-dlightmap
Force direct lighting into different lightmap than radiosity.
-stoponexit
Wait for a keypress on exit.
-nodetaillight
Don't light detail props.
-centersamples
Move sample centers.
-loghash
Log the sample hash table to samplehash.txt.
-onlydetail
Only light detail props and per-leaf lighting.
-maxdispsamplesize #
Set max displacement sample size (default: 512).
-FullMinidump
Write large minidumps on crash.
-OnlyStaticProps
Only perform direct static prop lighting.
-StaticPropNormals
When lighting static props, just show their normal vector.
-noskyboxrecurse
Turn off recursion into 3d skybox (skybox shadows on world).
-nossprops
Globally disable self-shadowing on static props.
-dumppropmaps (New with Source 2013)
Dump computed prop lightmaps.


Lights files

A light file is a plain text file that can be used to manipulate the way VRAD handles given materials when compiling static lighting. All lights files must have the .rad file extension and must be in the same folder as your gameinfo.txt.

There are:

  1. lights.rad, the global file.
  2. An auto-loaded map light file, using the format <map name>.rad. The file must be placed in the same folder as <map name>.vmf.
  3. Any number of additional lights files that can be added with the -lights parameter.

Rules

Lights files perform these functions, one rule per line:

<material> <red> <green> <blue> <intensity> <hdr_red> <hdr_green> <hdr_blue> <hdr_intensity>
Makes the material emit the given light value when applied to a brush face (hdr_ values are optional). Texture scale has an effect on final intensity.
Note:materials that aren't in a folder must have a slash before their name.
Note:This doesn't truly make the material itself emit light, it will actually just place a light entity at each luxel of any face using this material.

Warning: A func_detail with an emissive material applied on a face may randomly cause VRAD to fail computing lighting for the face.

noshadow <material name>
Prevents the named material from casting shadows.
forcetextureshadow <model path>.mdl
Enables translucency shadow testing for a model when VRAD is run with -TextureShadows. Path is relative to the models folder.
ldr:
hdr:
Prefixes to make any rule only apply to LDR or HDR lighting.
hdr:ldr:
Lines beginning with both tags (in that order) will always be ignored by VRAD. Can be used to add comments or quickly disable some entries.

See also