VRAD is the command-line tool that compiles a map's lightmaps 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 generally the slowest of the three compilers due to the many, many calculations it must perform. 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).
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. Be patient.
Use these in combination with expert compile mode or a batch file:
- Compiles lightmaps for both Low Dynamic Range and High Dynamic Range lighting models. Causes the compiler to run twice.
- Compile only LDR lightmaps.
- Compile only HDR lightmaps.
- Quick and dirty lighting. Has been known to leave dark lines around displacements.
- Increases the quality of light_environment and indirect lighting by spending more time firing rays.
- Load a custom lights file in addition to
lights.radand map-specific lights file. The file specified must be
- Set the maximum number of light ray bounces (default: 10).
- Set the threshold for smoothing groups, in degrees (default: 45).
- Scale down all luxels. Default (and maximum) value is 1.
- 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.
- Generate per-vertex
prop_staticlighting. This is always enabled for light_spot entities.
- Note:Depending on the number of static props in the level, this can dramatically increase the size of the .bsp file and the length of time needed for vrad to finish.
- Note:When using this setting, it disables all info_lighting entities in your level and it will light models as if there wasn't one linked to them.
- Perform shadow tests of
prop_statics at polygon precision. (Very processor-intensive - default is to use collision models.)
- Generates lightmap shadows from $translucent surfaces of models that are specified in a lights file and being used with prop_static. Usually requires
-StaticPropPolysto have any effect.
- Note:A surface will need a low lightmap scale for most texture shadows to be recognisable.
- Run as an low-priority process. Allows you to use your computer for other things during compiles.
- Control the number of threads used (defaults to the number of processors on your machine, doubled for CPUs with hyperthreading).
- Use VMPI to distribute computations.
- Use a password to choose a specific set of VMPI workers.
- Disable supersampling.
- Smallest number of luxel widths for a bounce patch, used on edges.
- Coarsest allowed number of luxel widths for a patch, used in face interiors.
- 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.
- Compress lightmaps whose color variation is less than n units.
- Emit bright red light from error locations?
- Override the VPROJECT environment variable.
- Turn on verbose output.
- Don't bring up graphical UI on vproject errors.
- Write debugging .txt files.
- Write normals to debug files.
- Places debugging data in lightmaps to visualize supersampling.
- Force direct lighting into different lightmap than radiosity.
- Wait for a keypress on exit.
- Don't light detail props.
- Move sample centers.
- Log the sample hash table to samplehash.txt.
- Only light detail props and per-leaf lighting.
- Set max displacement sample size (default: 512).
- Write large minidumps on crash.
- Only perform direct static prop lighting (vrad debug option)
- When lighting static props, just show their normal vector
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.
lights.rad, the global file.
- An auto-loaded map light file, using the format
- Any number of additional lights files that can be added with the
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.
noshadow <material name>
- Prevents the named material from casting shadows.
forcetextureshadow <model name>.mdl
- Enables translucency shadow testing for a model when VRAD is run with
- Prefixes to make any rule only apply to LDR or HDR lighting.