This article's documentation is for the "GoldSrc" engine. Click here for more information.
This article's documentation is for anything that uses the Source engine. Click here for more information.

RAD file

From Valve Developer Community
Jump to: navigation, search
English (en)Translate (Translate)

Icon-broom.png
This article or section needs to be cleaned up to conform to a higher standard of quality because:
Recently split from VRAD, in order to also cover QRAD and HLRAD
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.

A RAD file is a plain text file that can be used to manipulate the way QRAD, HLRAD, and VRAD handle given brush textures when compiling static lighting.

There are:

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

Where these are placed depends upon the engine; see below.

Note.pngNote:RAD files are removed in Source 2 Source 2, in favor of emissive materials (only in Counter-Strike 2) and light_rect.

GoldSrc GoldSrc

Obsolete-notext.pngDeprecated:Use info_texlights instead. Alternatively, light_surface can be used, providing more options.

All RAD files must have the .rad file extension and must be in the same folder as the map compile tools, except for <mapname>.rad, which should be in the same folder as the uncompiled MAP.

Rules

<texture> <red> <green> <blue> <intensity>
Defines a texlight, makes the texture appear to emit the given light value when applied to a brush face. Texture scale has an effect on final intensity.
Icon-Important.pngImportant:In VHLT, RAD lights with color set to 255 255 255 will use the average color of the texture instead of white.
// <comment>
Denotes an end-of-line comment. Anything after the two slashes will be ignored by HLRAD.
(Added in ZHLT v2.1; not available in QRAD.)

Source Source 1

All RAD files must have the .rad file extension and must be in the same folder as gameinfo.txt, except for <mapname>.rad, which should be in the same folder as the uncompiled VMF.

An example Source 1 rad file can be found here (from Half-Life 2).

Rules

Lights files perform these functions, one rule per line:

<material> <red> <green> <blue> <intensity> <hdr_red> <hdr_green> <hdr_blue> <hdr_intensity>
Defines a texlight, making the material appear to 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, spotlights are generated across the surface. More technically, lights are placed at the center of every subdivision on the surface. The brightness of each light is distributed uniformly, by taking the area of each subdivision. Lower lightmap scales will increase subdivision and therefore more lights will be created. This will not occur on textures that are unlit, as no subdivision occurs on these textures. Leaf splits will still incur subdivision however, which might make the light creation unpredictable (using a func_detail will avoid this). It may be cheaper to instead manually place light_spot entities near the material.
Note.pngNote:Unlike light however, texlights are directional, and only cast light in the 90 degrees in which the face faces. Unlike GoldSrc, a texlight will not directly illuminate the face which "casts" the light[citation needed] (although it can still receive indirect light). As such, materials intended to be used as texlights should be UnlitGeneric or $selfillum.
Note.pngNote:Materials that aren't in a folder must have a slash before their name.
Icon-Bug.pngBug:A func_detail with an emissive material applied on a face may randomly cause VRAD to fail computing lighting for the face; tie to func_brush instead.  [todo tested in?]
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, regardless of whether it was compiled with $casttextureshadows. Path is relative to the models folder.
ldr: <rule>
hdr: <rule>
Prefixes to make any rule only apply to SDR or HDR lighting.
hdr:ldr: <comment>
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