ericw-tools/doc/light.html

943 lines
31 KiB
HTML

<!-- Creator : groff version 1.19.2 -->
<!-- CreationDate: Mon Feb 19 00:01:35 2018 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
p { margin-top: 0; margin-bottom: 0; }
pre { margin-top: 0; margin-bottom: 0; }
table { margin-top: 0; margin-bottom: 0; }
</style>
<title>LIGHT</title>
</head>
<body>
<h1 align=center>LIGHT</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#MODEL ENTITY KEYS">MODEL ENTITY KEYS</a><br>
<a href="#LIGHT ENTITY KEYS">LIGHT ENTITY KEYS</a><br>
<a href="#OTHER INFORMATION">OTHER INFORMATION</a><br>
<a href="#AUTHOR">AUTHOR</a><br>
<a href="#REPORTING BUGS">REPORTING BUGS</a><br>
<a href="#COPYRIGHT">COPYRIGHT</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<a name="NAME"></a>
<h2>NAME</h2>
<p style="margin-left:11%; margin-top: 1em">light &minus;
Caclulate lightmap data for a Quake BSP file</p>
<a name="SYNOPSIS"></a>
<h2>SYNOPSIS</h2>
<p style="margin-left:11%; margin-top: 1em"><b>light</b>
[OPTION]... BSPFILE</p>
<a name="DESCRIPTION"></a>
<h2>DESCRIPTION</h2>
<p style="margin-left:11%; margin-top: 1em"><b>light</b>
reads a Quake .bsp file and calculates light and shadow
information based on the entity definitions contained in the
.bsp. The .bsp file is updated with the new light data upon
completion, overwriting any existing lighting data.</p>
<a name="OPTIONS"></a>
<h2>OPTIONS</h2>
<p style="margin-left:11%; margin-top: 1em">Note, any of
the Worldspawn Keys listed in the next section can be
supplied as command-line options, which will override any
setting in worldspawn.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Performance
options: <br>
-threads n</b></p>
<p style="margin-left:22%;">Set number of threads
explicitly. By default light will attempt to detect the
number of CPUs/cores available.</p>
<table width="100%" border=0 rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">
<p style="margin-top: 1em" valign="top"><b>-extra</b></p></td>
<td width="2%"></td>
<td width="78%">
<p style="margin-top: 1em" valign="top">Calculate extra
samples (2x2) and average the results for smoother
shadows.</p> </td>
</table>
<p style="margin-left:11%;"><b>-extra4</b></p>
<p style="margin-left:22%;">Calculate even more samples
(4x4) and average the results for smoother shadows.</p>
<p style="margin-left:11%;"><b>-gate n</b></p>
<p style="margin-left:22%;">Set a minimum light level,
below which can be considered zero brightness. This can
dramatically speed up processing when there are large
numbers of lights with inverse or inverse square falloff. In
most cases, values less than 1.0 will cause no discernable
visual differences. Default 0.001.</p>
<p style="margin-left:11%;"><b>-sunsamples [n]</b></p>
<p style="margin-left:22%;">Set the number of samples to
use for &quot;_sunlight_penumbra&quot; and
&quot;_sunlight2&quot; (sunlight2 may use more or less
because of how the suns are set up in a sphere). Default
100.</p>
<p style="margin-left:11%;"><b>-surflight_subdivide
[n]</b></p>
<p style="margin-left:22%;">Configure spacing of all
surface lights. Default 128 units. Minimum setting: 64 / max
2048. In the future I&rsquo;d like to make this configurable
per-surface-light.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Output
format options:</b></p>
<table width="100%" border=0 rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="6%">
<p valign="top"><b>-lit</b></p></td>
<td width="5%"></td>
<td width="78%">
<p valign="top">Force generation of a .lit file, even if
your map does not have any coloured lights. By default,
light will automatically generate the .lit file when
needed.</p> </td>
</table>
<p style="margin-left:11%;"><b>-onlyents</b></p>
<p style="margin-left:22%;">Updates the entities lump in
the bsp. You should run this after running qbsp with
-onlyents, if your map uses any switchable lights. All this
does is assign style numbers to each switchable light.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Postprocessing
options: <br>
-soft [n]</b></p>
<p style="margin-left:22%;">Perform post-processing on the
lightmap which averages adjacent samples to smooth shadow
edges. If n is specified, the algorithm will take
&rsquo;n&rsquo; samples on each side of the sample point and
replace the original value with the average. e.g. a value of
1 results in averaging a 3x3 square centred on the original
sample. 2 implies a 5x5 square and so on. If -soft is
specified, but n is omitted, a value will be the level of
oversampling requested. If no oversampling, then the implied
value is 1. -extra implies a value of 2 and -extra4 implies
3. Default 0 (off).</p>
<p style="margin-left:11%; margin-top: 1em"><b>Debug modes:
<br>
-dirtdebug</b></p>
<p style="margin-left:22%;">Implies &quot;-dirt&quot;, and
renders just the dirtmap against a fullbright background,
ignoring all lights in the map. Useful for previewing and
turning the dirt settings.</p>
<p style="margin-left:11%;"><b>-phongdebug</b></p>
<p style="margin-left:22%;">Write normals to lit file for
debugging phong shading.</p>
<p style="margin-left:11%;"><b>-bouncedebug</b></p>
<p style="margin-left:22%;">Write bounced lighting only to
the lightmap for debugging / previewing -bounce.</p>
<p style="margin-left:11%;"><b>-surflight_dump</b></p>
<p style="margin-left:22%;">Saves the lights generated by
surfacelights to a &quot;mapname-surflights.map&quot;
file.</p>
<p style="margin-left:11%;"><b>-novisapprox</b></p>
<p style="margin-left:22%;">Disable approximate visibility
culling of lights, which has a small chance of introducing
artifacts where lights cut off too soon.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Experimental
options: <br>
-addmin</b></p>
<p style="margin-left:22%;">Changes the behaviour of
<i>minlight</i>. Instead of increasing low light levels to
the global minimum, add the global minimum light level to
all style 0 lightmaps. This may help reducing the sometimes
uniform minlight effect.</p>
<table width="100%" border=0 rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="7%">
<p style="margin-top: 1em" valign="top"><b>-lit2</b></p></td>
<td width="4%"></td>
<td width="78%">
<p style="margin-top: 1em" valign="top">Force generation of
a .lit2 file, even if your map does not have any coloured
lights.</p> </td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="7%">
<p style="margin-top: 1em" valign="top"><b>-lux</b></p></td>
<td width="4%"></td>
<td width="78%">
<p style="margin-top: 1em" valign="top">Generate a .lux
file storing average incoming light directions for surfaces.
Usable by FTEQW with &quot;r_deluxemapping 1&quot;</p></td>
</table>
<p style="margin-left:11%;"><b>-lmscale n</b></p>
<p style="margin-left:22%;">Equivelent to
&quot;_lightmap_scale&quot; worldspawn key.</p>
<p style="margin-left:11%;"><b>-bspxlit</b></p>
<p style="margin-left:22%;">Writes rgb data into the bsp
itself.</p>
<table width="100%" border=0 rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="7%">
<p style="margin-top: 1em" valign="top"><b>-bspx</b></p></td>
<td width="4%"></td>
<td width="78%">
<p style="margin-top: 1em" valign="top">Writes both rgb and
directions data into the bsp itself.</p></td>
</table>
<p style="margin-left:11%;"><b>-novanilla</b></p>
<p style="margin-left:22%;">Fallback scaled lighting will
be omitted. Standard grey lighting will be ommitted if there
are coloured lights. Implies &quot;-bspxlit&quot;.
&quot;-lit&quot; will no longer be implied by the presence
of coloured lights.</p>
<a name="MODEL ENTITY KEYS"></a>
<h2>MODEL ENTITY KEYS</h2>
<p style="margin-left:11%; margin-top: 1em"><b>Worldspawn
Keys</b> <br>
The following keys can be added to the <i>worldspawn</i>
entity: <b><br>
&quot;light&quot; &quot;n&quot;</b> |
<b>&quot;_minlight&quot; &quot;n&quot;</b></p>
<p style="margin-left:22%;">Set a global minimum light
level of &quot;n&quot; across the whole map. This is an easy
way to eliminate completely dark areas of the level, however
you may lose some contrast as a result, so use with care.
Default 0.</p>
<p style="margin-left:11%;"><b>&quot;_minlight_color&quot;
&quot;r g b&quot;</b> | <b>&quot;_mincolor&quot; &quot;r g
b&quot;</b></p>
<p style="margin-left:22%;">Specify red(r), green(g) and
blue(b) components for the colour of the minlight. RGB
component values are between 0 and 255 (between 0 and 1 is
also accepted). Default is white light (&quot;255 255
255&quot;).</p>
<p style="margin-left:11%;"><b>&quot;_dist&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Scales the fade distance of all
lights by a factor of n. If n &gt; 1 lights fade more
quickly with distance and if n &lt; 1, lights fade more
slowly with distance and light reaches further.</p>
<p style="margin-left:11%;"><b>&quot;_range&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Scales the brightness range of
all lights without affecting their fade discance. Values of
n &gt; 0.5 makes lights brighter and n &lt; 0.5 makes lights
less bright. The same effect can be achieved on individual
lights by adjusting both the &quot;light&quot; and
&quot;wait&quot; attributes.</p>
<p style="margin-left:11%;"><b>&quot;_sunlight&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Set the brightness of the
sunlight coming from an unseen sun in the sky. Sky brushes
(or more accurately bsp leafs with sky contents) will emit
sunlight at an angle specified by the
&quot;_sun_mangle&quot; key. Default 0.</p>
<p style="margin-left:11%;"><b>&quot;_anglescale&quot;
&quot;n&quot;</b> | <b>&quot;_anglesense&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Set the scaling of sunlight
brightness due to the angle of incidence with a surface
(more detailed explanation in the &quot;_anglescale&quot;
light entity key below).</p>
<p style="margin-left:11%;"><b>&quot;_sunlight_mangle&quot;
&quot;yaw pitch roll&quot;</b> | <b>&quot;_sun_mangle&quot;
&quot;yaw pitch roll&quot;</b></p>
<p style="margin-left:22%;">Specifies the direction of
sunlight using yaw, pitch and roll in degrees. Yaw specifies
the angle around the Z-axis from 0 to 359 degrees and pitch
specifies the angle from 90 (shining straight up) to -90
(shining straight down from above). Roll has no effect, so
use any value (e.g. 0). Default is straight down (&quot;0
-90 0&quot;).</p>
<p style="margin-left:11%;"><b>&quot;_sunlight_penumbra&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Specifies the penumbra width,
in degrees, of sunlight. Useful values are 3-4 for a gentle
soft edge, or 10-20+ for more diffuse sunlight. Default is
0.</p>
<p style="margin-left:11%;"><b>&quot;_sunlight_color&quot;
&quot;r g b&quot;</b></p>
<p style="margin-left:22%;">Specify red(r), green(g) and
blue(b) components for the colour of the sunlight. RGB
component values are between 0 and 255 (between 0 and 1 is
also accepted). Default is white light (&quot;255 255
255&quot;).</p>
<p style="margin-left:11%;"><b>&quot;_sunlight2&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Set the brightness of a dome of
lights arranged around the upper hemisphere. (i.e. ambient
light, coming from above the horizon). Default 0.</p>
<p style="margin-left:11%;"><b>&quot;_sunlight_color2&quot;
&quot;r g b&quot;</b> | <b>&quot;_sunlight2_color&quot;
&quot;r g b&quot;</b></p>
<p style="margin-left:22%;">Specifies the colour of
_sunlight2, same format as &quot;_sunlight_color&quot;.
Default is white light (&quot;255 255 255&quot;).</p>
<p style="margin-left:11%;"><b>&quot;_sunlight3&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Same as &quot;_sunlight2&quot;,
but for the bottom hemisphere (i.e. ambient light, coming
from below the horizon). Combine &quot;_sunlight2&quot; and
&quot;_sunlight3&quot; to have light coming equally from all
directions, e.g. for levels floating in the clouds. Default
0.</p>
<p style="margin-left:11%;"><b>&quot;_sunlight_color3&quot;
&quot;r g b&quot;</b> | <b>&quot;_sunlight3_color&quot;
&quot;r g b&quot;</b></p>
<p style="margin-left:22%;">Specifies the colour of
&quot;_sunlight3&quot;. Default is white light (&quot;255
255 255&quot;).</p>
<p style="margin-left:11%;"><b>&quot;_dirt&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">1 enables dirtmapping (ambient
occlusion) on all lights, borrowed from q3map2. This adds
shadows to corners and crevices. You can override the global
setting for specific lights with the &quot;_dirt&quot; light
entitiy key or &quot;_sunlight_dirt&quot;,
&quot;_sunlight2_dirt&quot;, and &quot;_minlight_dirt&quot;
worldspawn keys. Default is no dirtmapping (-1).</p>
<p style="margin-left:11%;"><b>&quot;_sunlight_dirt&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">1 enables dirtmapping (ambient
occlusion) on sunlight, -1 to disable (making it illuminate
the dirtmapping shadows). Default is to use the value of
&quot;_dirt&quot;.</p>
<p style="margin-left:11%;"><b>&quot;_sunlight2_dirt&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">1 enables dirtmapping (ambient
occlusion) on sunlight2/3, -1 to disable. Default is to use
the value of &quot;_dirt&quot;.</p>
<p style="margin-left:11%;"><b>&quot;_minlight_dirt&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">1 enables dirtmapping (ambient
occlusion) on minlight, -1 to disable. Default is to use the
value of &quot;_dirt&quot;.</p>
<p style="margin-left:11%;"><b>&quot;_dirtmode&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Choose between ordered (0,
default) and randomized (1) dirtmapping.</p>
<p style="margin-left:11%;"><b>&quot;_dirtdepth&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Maximum depth of occlusion
checking for dirtmapping, default 128.</p>
<p style="margin-left:11%;"><b>&quot;_dirtscale&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Scale factor used in dirt
calculations, default 1. Lower values (e.g. 0.5) make the
dirt fainter, 2.0 would create much darker shadows.</p>
<p style="margin-left:11%;"><b>&quot;_dirtgain&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Exponent used in dirt
calculation, default 1. Lower values (e.g. 0.5) make the
shadows darker and stretch further away from corners.</p>
<p style="margin-left:11%;"><b>&quot;_dirtangle&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Cone angle in degrees for
occlusion testing, default 88. Allowed range 1-90. Lower
values can avoid unwanted dirt on arches, pipe interiors,
etc.</p>
<p style="margin-left:11%;"><b>&quot;_gamma&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Adjust brightness of final
lightmap. Default 1, &gt;1 is brighter, &lt;1 is darker.</p>
<p style="margin-left:11%;"><b>&quot;_lightmap_scale&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Forces all surfaces+submodels
to use this specific lightmap scale. Removes
&quot;LMSHIFT&quot; field.</p>
<p style="margin-left:11%;"><b>&quot;_bounce&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">1 enables bounce lighting,
disabled by default.</p>
<p style="margin-left:11%;"><b>&quot;_bouncescale&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Scales brightness of bounce
lighting, default 1.</p>
<p style="margin-left:11%;"><b>&quot;_bouncecolorscale&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Weight for bounce lighting to
use texture colors from the map: 0=ignore map textures
(default), 1=multiply bounce light color by texture
color.</p>
<p style="margin-left:11%;"><b>&quot;_bouncestyled&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">1 makes styled lights bounce
(e.g. flickering or switchable lights), default is 0, they
do not bounce.</p>
<p style="margin-left:11%;"><b>&quot;_spotlightautofalloff&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">When set to 1, spotlight
falloff is calculated from the distance to the targeted
info_null. Ignored when &quot;_falloff&quot; is not 0.
Default 0.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Model Entity
Keys</b> <br>
The following keys can be used on any entity with a brush
model. &quot;_minlight&quot;, &quot;_mincolor&quot;,
&quot;_dirt&quot;, &quot;_phong&quot;,
&quot;_phong_angle&quot;, &quot;_phong_angle_concave&quot;,
&quot;_shadow&quot; are supported on func_detail/func_group
as well, if qbsp from these tools is used. <b><br>
&quot;_minlight&quot; &quot;n&quot;</b></p>
<p style="margin-left:22%;">Set the minimum light level for
any surface of the brush model. Default 0.</p>
<p style="margin-left:11%;"><b>&quot;_minlight_exclude&quot;
&quot;texname&quot;</b></p>
<p style="margin-left:22%;">Faces with the given texture
are excluded from receiving minlight on this brush
model.</p>
<p style="margin-left:11%;"><b>&quot;_minlight_color&quot;
&quot;r g b&quot;</b> | <b>&quot;_mincolor&quot; &quot;r g
b&quot;</b></p>
<p style="margin-left:22%;">Specify red(r), green(g) and
blue(b) components for the colour of the minlight. RGB
component values are between 0 and 255 (between 0 and 1 is
also accepted). Default is white light (&quot;255 255
255&quot;).</p>
<p style="margin-left:11%;"><b>&quot;_shadow&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">If n is 1, this model will cast
shadows on other models and itself (i.e. &quot;_shadow&quot;
implies &quot;_shadowself&quot;). Note that this
doesn&rsquo;t magically give Quake dynamic lighting powers,
so the shadows will not move if the model moves. Set to -1
on func_detail/func_group to prevent them from casting
shadows. Default 0.</p>
<p style="margin-left:11%;"><b>&quot;_shadowself&quot;
&quot;n&quot;</b> | <b>&quot;_selfshadow&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">If n is 1, this model will cast
shadows on itself if one part of the model blocks the light
from another model surface. This can be a better compromise
for moving models than full shadowing. Default 0.</p>
<p style="margin-left:11%;"><b>&quot;_shadowworldonly&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">If n is 1, this model will cast
shadows on the world only (not other bmodels).</p>
<p style="margin-left:11%;"><b>&quot;_switchableshadow&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">If n is 1, this model casts a
shadow that can be switched on/off using QuakeC. To make
this work, a lightstyle is automatically assigned and stored
in a key called &quot;switchshadstyle&quot;, which the
QuakeC will need to read and call the
&quot;lightstyle()&quot; builtin with &quot;a&quot; or
&quot;m&quot; to switch the shadow on or off. Entities
sharing the same targetname, and with
&quot;_switchableshadow&quot; set to 1, will share the same
lightstyle.</p>
<p style="margin-left:11%;"><b>&quot;_dirt&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">For brush models, -1 prevents
dirtmapping on the brush model. Useful it the bmodel touches
or sticks into the world, and you want to those ares from
turning black. Default 0.</p>
<p style="margin-left:11%;"><b>&quot;_phong&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">1 enables phong shading on this
model with a default _phong_angle of 89 (softens columns
etc).</p>
<p style="margin-left:11%;"><b>&quot;_phong_angle&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Enables phong shading on faces
of this model with a custom angle. Adjacent faces with
normals this many degrees apart (or less) will be smoothed.
Consider setting &quot;_anglescale&quot; to &quot;1&quot; on
lights or worldspawn to make the effect of phong shading
more visible. Use the &quot;-phongdebug&quot; command-line
flag to save the interpolated normals to the lightmap for
previewing (use &quot;r_lightmap 1&quot; or
&quot;gl_lightmaps 1&quot; in your engine to preview.)</p>
<p style="margin-left:11%;"><b>&quot;_phong_angle_concave&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Optional key for setting a
different angle threshold for concave joints. A pair of
faces will either use &quot;_phong_angle&quot; or
&quot;_phong_angle_concave&quot; as the smoothing threshold,
depending on whether the joint between the faces is concave
or not. &quot;_phong_angle(_concave)&quot; is the maximum
angle (in degrees) between the face normals that will still
cause the pair of faces to be smoothed. The minimum setting
for &quot;_phong_angle_concave&quot; is 1, this should make
all concave joints non-smoothed (unless they&rsquo;re less
than 1 degree apart, almost a flat plane.) If it&rsquo;s 0
or unset, the same value as &quot;_phong_angle&quot; is
used.</p>
<p style="margin-left:11%;"><b>&quot;_lightignore&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">1 makes a model receive
minlight only, ignoring all lights / sunlight. Could be
useful on rotators / trains.</p>
<a name="LIGHT ENTITY KEYS"></a>
<h2>LIGHT ENTITY KEYS</h2>
<p style="margin-left:11%; margin-top: 1em">Light entity
keys can be used in any entity with a classname starting
with the first five letters &quot;light&quot;. E.g.
&quot;light&quot;, &quot;light_globe&quot;,
&quot;light_flame_small_yellow&quot;, etc. <b><br>
&quot;light&quot; &quot;n&quot;</b></p>
<p style="margin-left:22%;">Set the light intensity.
Negative values are also allowed and will cause the entity
to subtract light cast by other entities. Default 300.</p>
<p style="margin-left:11%;"><b>&quot;wait&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Scale the fade distance of the
light by &quot;n&quot;. Values of n &gt; 1 make the light
fade more quickly with distance, and values &lt; 1 make the
light fade more slowly (and thus reach further). Default
1.</p>
<p style="margin-left:11%;"><b>&quot;delay&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Select an attenuation formaula
for the light: <br>
0 =&gt; Linear attenuation (default) <br>
1 =&gt; 1/x attenuation <br>
2 =&gt; 1/(x^2) attenuation <br>
3 =&gt; No attenuation (same brightness at any distance)
<br>
4 =&gt; &quot;local minlight&quot; - No attenuation and like
minlight, <br>
it won&rsquo;t raise the lighting above it&rsquo;s light
value. <br>
Unlike minlight, it will only affect surfaces within <br>
line of sight of the entity. <br>
5 =&gt; 1/(x^2) attenuation, but slightly more attenuated
and <br>
without the extra bright effect that &quot;delay 2&quot; has
<br>
near the source.</p>
<p style="margin-left:11%;"><b>&quot;_falloff&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Sets the distance at which the
light drops to 0, in map units.</p>
<p style="margin-left:22%; margin-top: 1em">In this mode,
&quot;wait&quot; is ignored and &quot;light&quot; only
controls the brightness at the center of the light, and no
longer affects the falloff distance.</p>
<p style="margin-left:22%; margin-top: 1em">Only supported
on linear attenuation (delay 0) lights currently.</p>
<p style="margin-left:11%;"><b>&quot;_color&quot; &quot;r g
b&quot;</b></p>
<p style="margin-left:22%;">Specify red(r), green(g) and
blue(b) components for the colour of the light. RGB
component values are between 0 and 255 (between 0 and 1 is
also accepted). Default is white light (&quot;255 255
255&quot;).</p>
<p style="margin-left:11%;"><b>&quot;target&quot;
&quot;name&quot;</b></p>
<p style="margin-left:22%;">Turns the light into a
spotlight, with the direction of light being towards another
entity with it&rsquo;s &quot;targetname&quot; key set to
&quot;name&quot;.</p>
<p style="margin-left:11%;"><b>&quot;mangle&quot; &quot;yaw
pitch roll&quot;</b></p>
<p style="margin-left:22%;">Turns the light into a
spotlight and specifies the direction of light using yaw,
pitch and roll in degrees. Yaw specifies the angle around
the Z-axis from 0 to 359 degrees and pitch specifies the
angle from 90 (straight up) to -90 (straight down). Roll has
no effect, so use any value (e.g. 0). Often easier than the
&quot;target&quot; method.</p>
<p style="margin-left:11%;"><b>&quot;angle&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Specifies the angle in degrees
for a spotlight cone. Default 40.</p>
<p style="margin-left:11%;"><b>&quot;_softangle&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Specifies the angle in degrees
for an inner spotlight cone (must be less than the
&quot;angle&quot; cone. Creates a softer transition between
the full brightness of the inner cone to the edge of the
outer cone. Default 0 (disabled).</p>
<p style="margin-left:11%;"><b>&quot;targetname&quot;
&quot;name&quot;</b></p>
<p style="margin-left:22%;">Turns the light into a
switchable light, toggled by another entity targeting
it&rsquo;s name.</p>
<p style="margin-left:11%;"><b>&quot;style&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Set the animated light style.
Default 0.</p>
<p style="margin-left:11%;"><b>&quot;_anglescale&quot;
&quot;n&quot;</b> | <b>&quot;_anglesense&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Sets a scaling factor for how
much influence the angle of incidence of light on a surface
has on the brightness of the surface. <i>n</i> must be
between 0.0 and 1.0. Smaller values mean less attenuation,
with zero meaning that angle of incidence has no effect at
all on the brightness. Default 0.5.</p>
<p style="margin-left:11%;"><b>&quot;_dirtscale&quot;
&quot;n&quot;</b> | <b>&quot;_dirtgain&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Override the global
&quot;_dirtscale&quot; or &quot;_dirtgain&quot; settings to
change how this light is affected by dirtmapping (ambient
occlusion). See descriptions of these keys in the worldspawn
section.</p>
<p style="margin-left:11%;"><b>&quot;_dirt&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Overrides the worldspawn
setting of &quot;_dirt&quot; for this particular light. -1
to disable dirtmapping (ambient occlusion) for this light,
making it illuminate the dirtmapping shadows. 1 to enable
ambient occlusion for this light. Default is to defer to the
worldspawn setting.</p>
<p style="margin-left:11%;"><b>&quot;_deviance&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Split up the light into a
sphere of randomly positioned lights within radius
&quot;n&quot; (in world units). Useful to give shadows a
wider penumbra. &quot;_samples&quot; specifies the number of
lights in the sphere. The &quot;light&quot; value is
automatically scaled down for most lighting formulas (except
linear and non-additive minlight) to attempt to keep the
brightness equal. Default is 0, do not split up lights.</p>
<p style="margin-left:11%;"><b>&quot;_samples&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Number of lights to use for
&quot;_deviance&quot;. Default 16 (only used if
&quot;_deviance&quot; is set).</p>
<p style="margin-left:11%;"><b>&quot;_surface&quot;
&quot;texturename&quot;</b></p>
<p style="margin-left:22%;">Makes surfaces with the given
texture name emit light, by using this light as a template
which is copied across those surfaces. Lights are spaced
about 128 units (though possibly closer due to bsp
splitting) apart and positioned 2 units above the
surfaces.</p>
<p style="margin-left:11%;"><b>&quot;_surface_offset&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Controls the offset lights are
placed above surfaces for &quot;_surface&quot;. Default
2.</p>
<p style="margin-left:11%;"><b>&quot;_surface_spotlight&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">For a surface light template
(i.e. a light with &quot;_surface&quot; set), setting this
to &quot;1&quot; makes each instance into a spotlight, with
the direction of light pointing along the surface normal. In
other words, it automatically sets &quot;mangle&quot; on
each of the generated lights.</p>
<p style="margin-left:11%;"><b>&quot;_project_texture&quot;
&quot;texture&quot;</b></p>
<p style="margin-left:22%;">Specifies that a light should
project this texture. The texture must be used in the map
somewhere.</p>
<p style="margin-left:11%;"><b>&quot;_project_mangle&quot;
&quot;yaw pitch roll&quot;</b></p>
<p style="margin-left:22%;">Specifies the yaw/pitch/roll
angles for a texture projection (overriding mangle).</p>
<p style="margin-left:11%;"><b>&quot;_project_fov&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Specifies the fov angle for a
texture projection. Default 90.</p>
<p style="margin-left:11%;"><b>&quot;_bouncescale&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Scales the amount of light that
is contributed by bounces. Default is 1.0, 0.0 disables
bounce lighting for this light.</p>
<p style="margin-left:11%;"><b>&quot;_sun&quot;
&quot;n&quot;</b></p>
<p style="margin-left:22%;">Set to 1 to make this entity a
sun, as an alternative to using the sunlight worldspawn
keys. If the light targets an info_null entity, the
direction towards that entity sets sun direction. The light
itself is disabled, so it can be placed anywhere in the
map.</p>
<p style="margin-left:22%; margin-top: 1em">The following
light properties correspond to these sunlight settings: <br>
light =&gt; _sunlight <br>
mangle =&gt; _sunlight_mangle <br>
deviance =&gt; _sunlight_penumbra <br>
_color =&gt; _sunlight_color <br>
_dirt =&gt; _sunlight_dirt <br>
_anglescale =&gt; _anglescale</p>
<a name="OTHER INFORMATION"></a>
<h2>OTHER INFORMATION</h2>
<p style="margin-left:11%; margin-top: 1em">The
&quot;\b&quot; escape sequence toggles red text on/off, you
can use this in any strings in the map file. e.g.
&quot;message&quot; &quot;Here is \bsome red
text\b...&quot;</p>
<a name="AUTHOR"></a>
<h2>AUTHOR</h2>
<p style="margin-left:11%; margin-top: 1em">Eric Wasylishen
<br>
Kevin Shanahan (aka Tyrann) - http://disenchant.net <br>
David Walton (aka spike) <br>
Based on source provided by id Software</p>
<a name="REPORTING BUGS"></a>
<h2>REPORTING BUGS</h2>
<p style="margin-left:11%; margin-top: 1em">Please post bug
reports at https://github.com/ericwa/ericw-tools/issues.
<br>
Improvements to the documentation are welcome and
encouraged.</p>
<a name="COPYRIGHT"></a>
<h2>COPYRIGHT</h2>
<p style="margin-left:11%; margin-top: 1em">Copyright (C)
2017 Eric Wasylishen <br>
Copyright (C) 2013 Kevin Shanahan <br>
Copyright (C) 1997 id Software <br>
License GPLv2+: GNU GPL version 2 or later <br>
&lt;http://gnu.org/licenses/gpl2.html&gt;.</p>
<p style="margin-left:11%; margin-top: 1em">This is free
software: you are free to change and redistribute it. There
is NO WARRANTY, to the extent permitted by law.</p>
<a name="SEE ALSO"></a>
<h2>SEE ALSO</h2>
<p style="margin-left:11%; margin-top: 1em"><b>qbsp</b>(1)
<b>vis</b>(1) <b>bspinfo</b>(1) <b>bsputil</b>(1)
<b>quake</b>(6)</p>
<hr>
</body>
</html>