VRAD
 VRAD is the command-line tool for
 VRAD is the command-line tool for  Source 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
 Source 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.
 radiosity algorithm.
VRAD will:
- Generate lightmaps
- Generate ambient samples
- Generate per-vertex prop_static lighting
- Generate per-object detail prop lighting
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.
Syntax
For example, a regular compile would look like thus:
This will generate and embed both Standard and High Dynamic Range lighting data, at per-vertex detail for prop_static entities. It also generates shadows based on transparency for prop_static entities that have been flagged as casting texture shadows.
Options
Use these in combination with expert compile mode, a batch file, or a frontend such as  Compile Pal.
 Compile Pal.
Effects
{{ColumnBox|count=1|1=Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO
Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO
Performance
Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO
Template:CLIOTemplate:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO
Debugging
Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO Template:CLIO
Debug mode options
If VRAD is compiled in debug mode or the #if ALLOWDEBUGOPTIONS preprocessor is removed, additional options are available.
Template:CLIO
Template:CLIO
Template:CLIO
Template:CLIO
Template:CLIO
Template:CLIO
Lights files
Console Output
Bugs and Caveats
 Warning:VRAD does not compile shadows based on transparent/translucent brushes or displacements. If you must have shadows made by a brush (such as a fence texture), you can turn the brush into a prop via
Warning:VRAD does not compile shadows based on transparent/translucent brushes or displacements. If you must have shadows made by a brush (such as a fence texture), you can turn the brush into a prop via  SourceIO,
 SourceIO,  Crafty or Propper++ and put it into the RAD file or compile with $casttextureshadows. Alternatively, use an existing fence prop or the "blocklight" tool texture.
 Crafty or Propper++ and put it into the RAD file or compile with $casttextureshadows. Alternatively, use an existing fence prop or the "blocklight" tool texture.
 Warning:VRAD will use 100% of your CPU unless specified otherwise with the -threads # launch option.
Warning:VRAD will use 100% of your CPU unless specified otherwise with the -threads # launch option. Bug:In
Bug:In  and
 and  , users seeing crashes when VRAD compiles HDR lighting should read VRAD HDR Crash Fix.
, users seeing crashes when VRAD compiles HDR lighting should read VRAD HDR Crash Fix. Bug:In games before
Bug:In games before  , .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.
, .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. Tip:A windows batch file to do this automatically has been created here, extract the zip contents into your game's models folder and run the included .ps1 file.
Tip:A windows batch file to do this automatically has been created here, extract the zip contents into your game's models folder and run the included .ps1 file. )
) Bug:.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 ?]
Bug:.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 ?] Bug:Since the release of Source SDK 2013 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. This issue is fixed in
Bug:Since the release of Source SDK 2013 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. This issue is fixed in  ,
,  ,
,  ,
,  and
 and  .
.
 ? Also in Source 2007 and earlier, and Alien Swarm SDK,
? Also in Source 2007 and earlier, and Alien Swarm SDK, raytrace.cpp isn't present so check if these versions also have the bug or not.
 )
)
 Bug:Randomly causes corrupt lightmaps that look like "ink spills" or light splotches. These can be mostly avoided by not using very long or diagonal brushes, as well as not having too low of a light level in your indoor areas.
Bug:Randomly causes corrupt lightmaps that look like "ink spills" or light splotches. These can be mostly avoided by not using very long or diagonal brushes, as well as not having too low of a light level in your indoor areas.
- [todo tested in ?] Tip:Source Engine BSP Lightmap Editor can be used to manually correct a .bsp lightmap data. Tip:Source Engine BSP Lightmap Editor can be used to manually correct a .bsp lightmap data.
 Note: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 calculation.
Note: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 calculation. Note:Super sampling is not implemented on displacements (before
Note:Super sampling is not implemented on displacements (before  ) and lightmapped props. The former is fixed in
) and lightmapped props. The former is fixed in  Slammin' Source Map Tools.
 Slammin' Source Map Tools.  Workaround:For the latter, compile the lightmap at a higher resolution than necessary, then downscale it and use as a $lightmap.
Workaround:For the latter, compile the lightmap at a higher resolution than necessary, then downscale it and use as a $lightmap.See also
- QRAD and HLRAD -  GoldSrc counterparts. GoldSrc counterparts.
- VRAD2 & VRAD3 -  Source 2 counterparts. Source 2 counterparts.
- Map Compiling Theory
- HDR Lighting Basics
- VRAD HDR Crash Fix
- Static Props show up black
| 
 | |||||||||||||||||||||||||||||








































