VRAD: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Updated lights.rad section to indicate that it will place lights at each luxel)
(Changed parameters to use IO templates, added some BMS parameters, misc improvements)
Line 19: Line 19:
{{bug|Ep1 and L4D users seeing crashes when VRAD compiles HDR lighting should read [[VRAD HDR Crash Fix]].}}
{{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.}}
{{bug|In pre-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)
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|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|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".}}
{{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.}}
: {{tip|[https://github.com/Enderlux/sourcelightmap Source Engine BSP Lightmap Editor] can be used to manually correct a .bsp lightmap data.}}


== Syntax ==
== Syntax ==
Line 43: Line 43:


{{ColumnBox|count=2|
{{ColumnBox|count=2|
; <code>-ldr</code>
{{IO|-ldr}}
; <code>-hdr</code>
{{IO|-hdr}}
; <code>-both</code>
{{IO|-both|Whether to compile standard or [[HDR|High Dynamic Range]] lighting, or both.
: Whether to compile standard or [[HDR|High Dynamic Range]] lighting, or both.
: {{note|In {{insurgency}}{{csgo}}, you MUST compile with <code>-hdr</code> in order have proper lighting, as LDR isn't supported.}}}}
: {{note|In {{insurgency}}{{csgo}}, you MUST compile with -hdr in order have proper lighting, as LDR isn't supported.}}
{{IO|-fast|Quick and dirty lighting. Don't ship with this.
;<code>-fast</code>
: {{Note|<code>-fast</code> will cause random and miscolored splotching to appear in darker areas.}}}}
: Quick and dirty lighting. Don't ship with this.
{{IO|-final|Increases the quality of {{ent|light_environment}} and indirect lighting by spending more time firing rays.}}
;<code>-final</code>
{{IO|-extrasky|param=int|Trace N times as many rays for indirect light and sky ambient. {{clr}}(<code>-final</code> is equivalent to <code>-extrasky 16</code>; normal is equivalent to <code>-extrasky 1</code>)}}
: Increases the quality of [[light_environment]] and indirect lighting by spending more time firing rays.
{{IO|-lights <filename>.rad|Load a custom [[#Lights_files|lights file]] in addition to <code>lights.rad</code> and the map-specific lights file. Include the file extension in the parameter.}}
;<code>-extrasky <[[int]]></code>
{{IO|-bounce|param=int|Set the maximum number of light ray bounces. (default: 100).}}
: 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)
{{IO|-smooth|param=int|Set the threshold for [[smoothing group]]s, in degrees (default: 45).}}
;<code>-lights <filename>.rad</code>
{{IO|-luxeldensity|param=normal|Scale down all luxels. Default (and maximum) value is 1.}}
: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.
{{IO|-softsun|param=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 for <code>light_environment</code>, use that instead.}}
;<code>-bounce <[[int]]></code>
{{IO|-StaticPropLighting|Generate per-vertex lighting on {{ent|prop_static}}s; always enabled for {{ent|light_spot}} entities. Disables {{ent|info_lighting}} entities on props without [[bump maps]]. Does not work on props with bump maps, except in {{csgo}}.  
: Set the maximum number of light ray bounces (default: 100).
: {{Warning|This can increase your map's filesize substantially. Disable vertex lighting for props that don't need it to keep filesize low.}}
;<code>-smooth <[[int]]></code>
: {{note|In {{csgo}}, in order to get proper lighting on your static props, you will need to run VRAD with this command.}}|since=EP2}}
:Set the threshold for [[smoothing group]]s, in degrees (default: 45).
{{IO|-StaticPropPolys|Use the actual meshes of static props to generate shadows instead of using their [[collision mesh]]es. This results in far more accurate shadowing.|since=EP2}}
;<code>-luxeldensity <[[normal]]></code>
{{IO|-TextureShadows|Generates lightmap shadows from {{ent|$translucent}} surfaces of models (NOT brushes) that are specified in a [[#Lights_files|lights file]] and being used with <code>prop_static</code>. Usually requires <code>-StaticPropPolys</code> to have any effect.
:Scale down all luxels. Default (and maximum) value is 1.
: {{note|A surface will need a low [[lightmap]] scale for most texture shadows to be recognisable.}}
;<code>-softsun <[[float]]></code>
: {{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.}}|since=EP2}}
: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]].
{{IO|-aoscale|param=float|Scales the intensity of VRAD's simulated ambient occlusion. 1.0 is default.
 
: {{Tip|Valve uses 1.5 for the new Dust 2.}}|since=CSGO}}
 
{{IO|-aoradius|param=float|Set the radius of VRAD's simulated ambient occlusion. {{TODO|Figure out what exactly this does.}}|only=Ins}}
;<code>-StaticPropLighting</code>
{{IO|-aosamples|param=int|How many samples to use for VRAD's simulated ambient occlusion.|only=Ins}}
: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}}.  
{{IO|-StaticPropBounce|param=int|Number of static prop light bounces to simulate. The default is 0.
:{{note|In {{csgo}}, in order to get proper lighting on your static props, you will need to run VRAD with this command.}}
: {{Tip|Valve uses 3 static prop bounces for the new Dust 2.}}
:{{Warning|This can increase your map's filesize substantially. Disable vertex lighting for props that don't need it to keep filesize low.}}
: {{Note|Any static props that you want light to bounce off of must also have their "Enable Bounced Lighting" keyvalue set.}}|only=CSGO}}
;{{EP2 add|<code>-StaticPropPolys</code>}}
{{IO|-StaticPropLightingFinal|Compiles higher quality lighting for static props.|only=CSGO}}
:Perform shadow tests of <code>prop_static</code>s at polygon precision. Default is to use [[collision mesh]]es.
{{IO|-StaticPropLightingOld|Will use the old lighting algorithm on props, light affects them much more.|only=CSGO}}
;{{EP2 add|<code>-TextureShadows</code>}}
{{IO|-choptexlights|Enables chopping of texture lights generated from a lights file. Control texture light quality with lightmap density in Hammer. Dramatically increases both texture light quality and compile time.|only=BMS}}
: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.
{{IO|-extratransfers|Enable overscaling of light transfers.|only=BMS}}
:{{note|A surface will need a low [[lightmap]] scale for most texture shadows to be recognisable.}}
{{IO|-transferscale|param=float|This is the scale factor of light transfers. Increased values make surfaces transfer extra light (scale of 2-4 suggested). Default 1.0.|only=BMS}}
:{{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.}}
{{IO|-satthresh|param=float|This is the threshold that checks how saturated a material color is. Used with <code>-satthreshscale</code>. Default 0.4.|only=BMS}}
;{{CSGO add|<code>-aoscale <[[float]]></code>}}
{{IO|-satthreshscale|param=float|The amount to scale light transfers from surfaces that pass the saturation threshold. Default 3.0.|only=BMS}}
: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.
}}
}}


Line 96: Line 82:


{{ColumnBox|count=2|
{{ColumnBox|count=2|
;<code>-low</code>
{{IO|-low|Run as a low-priority process.}}
:Run as a low-priority process.
{{IO|-threads|param=int|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>-threads <[[int]]></code>
{{IO|-mpi|Use [[Vmpi|VMPI]] to distribute computations.}}
: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.  
{{IO|-mpi_pw|param=string|Use a password to choose a specific set of VMPI workers.}}
;<code>-mpi</code>
{{IO|-noextra|Disable supersampling. This will lead to blockier, more inaccurate lighting.}}
:Use [[Vmpi|VMPI]] to distribute computations.
{{IO|-chop|param=int|Smallest number of [[luxel]] widths for a bounce patch, used on edges. (Default: 4)}}
;<code>-mpi_pw <[[string]]></code>
{{IO|-maxchop|param=int|Coarsest allowed number of luxel widths for a patch, used in face interiors. (Default: 4)}}
:Use a password to choose a specific set of VMPI workers.
{{IO|-dispchop|param=int|Smallest acceptable [[luxel]] width of displacement patch face. (Default: 8)}}
;<code>-noextra</code>
{{IO|-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.}}
:Disable supersampling.
{{IO|-compressconstant|param=int|Compress [[lightmap]]s whose color variation is less than this many units.}}
;<code>-chop <int></code>
{{IO|-fastambient|Uses low quality per-leaf ambient sampling to save compute time.}}
:Smallest number of [[luxel]] widths for a bounce patch, used on edges. (Default: 4)
{{IO|-noao|Disables compiling simulated ambient occlusion for lightmaps.|only=Ins}}
;<code>-maxchop <int></code>
{{IO|-StaticPropSampleScale|param=int|Regulates the generated per-vertex prop_static lighting.
:Coarsest allowed number of luxel widths for a patch, used in face interiors. (Default: 4)
: slow: 16 (high quality); default: 4 (normal); fast: 0.25 (low quality)
;<code>-dispchop <int></code>
: {{note|-final is the equivalent of having -StaticPropLightingScale 16.}}|only=CSGO}}
:Smallest acceptable [[luxel]] width of displacement patch face. (Default: 8)
;<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.
;<code>-compressconstant <int></code>
: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.}}
}}
}}


Line 129: Line 102:


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


Line 191: Line 142:


;<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|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.}}
:{{Note|The material does not truly emit light, but instead, a {{ent|light}} entity is [https://developer.valvesoftware.com/w/images/8/8e/Lightsrad_light_generation.png generated every four luxels across a brush face using a lit material.] It may be smarter and cheaper to instead manually place <code>light</code> entities near the material.}}
:{{note|Materials that aren't in a folder must have a slash before their name.}}
{{warning|A [[func_detail]] with an emissive material applied on a face may randomly cause VRAD to fail computing lighting for the face.}}
{{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>

Revision as of 16:03, 14 December 2019

Template:Otherlang2

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.pngTip: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.pngWarning:VRAD will take up a lot of CPU during conversion of trying to make light.
Icon-Bug.pngBug:Ep1 and L4D users seeing crashes when VRAD compiles HDR lighting should read VRAD HDR Crash Fix.  [todo tested in ?]
Icon-Bug.pngBug:In pre-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.  [todo tested in ?]

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

Icon-Bug.pngBug: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.  [todo tested in ?]
Icon-Bug.pngBug: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.  [todo tested in ?]
Icon-Bug.pngBug:Randomly causes corrupt lightmaps that look like "ink spills".  [todo tested in ?]
Tip.pngTip: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.pngNote:In InsurgencyCounter-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.
Note.pngNote:-fast will cause random and miscolored splotching to appear in darker areas.
-final
Increases the quality of light_environment and indirect lighting by spending more time firing rays.
-extrasky <integerRedirectInput/integer>
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 the map-specific lights file. Include the file extension in the parameter.
-bounce <integerRedirectInput/integer>
Set the maximum number of light ray bounces. (default: 100).
-smooth <integerRedirectInput/integer>
Set the threshold for smoothing groups, in degrees (default: 45).
-luxeldensity <normal>
Scale down all luxels. Default (and maximum) value is 1.
-softsun <floatRedirectInput/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 for light_environment, use that instead.
-StaticPropLighting  (in all games since Half-Life 2: Episode Two)
Generate per-vertex lighting on prop_statics; always enabled for light_spot entities. Disables info_lighting entities on props without bump maps. Does not work on props with bump maps, except in Counter-Strike: Global Offensive.
Warning.pngWarning:This can increase your map's filesize substantially. Disable vertex lighting for props that don't need it to keep filesize low.
Note.pngNote:In Counter-Strike: Global Offensive, in order to get proper lighting on your static props, you will need to run VRAD with this command.
-StaticPropPolys  (in all games since Half-Life 2: Episode Two)
Use the actual meshes of static props to generate shadows instead of using their collision meshes. This results in far more accurate shadowing.
-TextureShadows  (in all games since Half-Life 2: Episode Two)
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.pngNote:A surface will need a low lightmap scale for most texture shadows to be recognisable.
Note.pngNote: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 <floatRedirectInput/float> (in all games since Counter-Strike: Global Offensive)
Scales the intensity of VRAD's simulated ambient occlusion. 1.0 is default.
Tip.pngTip:Valve uses 1.5 for the new Dust 2.
-aoradius <floatRedirectInput/float> (only in Insurgency)
Set the radius of VRAD's simulated ambient occlusion.
Todo: Figure out what exactly this does.
-aosamples <integerRedirectInput/integer> (only in Insurgency)
How many samples to use for VRAD's simulated ambient occlusion.
-StaticPropBounce <integerRedirectInput/integer> (only in Counter-Strike: Global Offensive)
Number of static prop light bounces to simulate. The default is 0.
Tip.pngTip:Valve uses 3 static prop bounces for the new Dust 2.
Note.pngNote:Any static props that you want light to bounce off of must also have their "Enable Bounced Lighting" keyvalue set.
-StaticPropLightingFinal  (only in Counter-Strike: Global Offensive)
Compiles higher quality lighting for static props.
-StaticPropLightingOld  (only in Counter-Strike: Global Offensive)
Will use the old lighting algorithm on props, light affects them much more.
-choptexlights  (only in Black Mesa)
Enables chopping of texture lights generated from a lights file. Control texture light quality with lightmap density in Hammer. Dramatically increases both texture light quality and compile time.
-extratransfers  (only in Black Mesa)
Enable overscaling of light transfers.
-transferscale <floatRedirectInput/float> (only in Black Mesa)
This is the scale factor of light transfers. Increased values make surfaces transfer extra light (scale of 2-4 suggested). Default 1.0.
-satthresh <floatRedirectInput/float> (only in Black Mesa)
This is the threshold that checks how saturated a material color is. Used with -satthreshscale. Default 0.4.
-satthreshscale <floatRedirectInput/float> (only in Black Mesa)
The amount to scale light transfers from surfaces that pass the saturation threshold. Default 3.0.

Performance


-low
Run as a low-priority process.
-threads <integerRedirectInput/integer>
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 <stringRedirectInput/string>
Use a password to choose a specific set of VMPI workers.
-noextra
Disable supersampling. This will lead to blockier, more inaccurate lighting.
-chop <integerRedirectInput/integer>
Smallest number of luxel widths for a bounce patch, used on edges. (Default: 4)
-maxchop <integerRedirectInput/integer>
Coarsest allowed number of luxel widths for a patch, used in face interiors. (Default: 4)
-dispchop <integerRedirectInput/integer>
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 <integerRedirectInput/integer>
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 <integerRedirectInput/integer> (only in 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.pngNote:-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>
Todo: 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 <integerRedirectInput/integer>
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  (only in Source 2013 Multiplayer)
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.pngNote:The material does not truly emit light, but instead, a light entity is generated every four luxels across a brush face using a lit material. It may be smarter and cheaper to instead manually place light entities near the material.
Note.pngNote:Materials that aren't in a folder must have a slash before their name.
Warning.pngWarning: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