Sunlight: Worldspawn

Worldspawn Suns
    _sun_color
    _sun_diffuse
    _sun_diffade, _sun_difwait
    _sun_light
    _sun_style
Worldspawn Sun Aiming
    _sun_angle, _sun_mangle
    _sun_target, _sun
    _sun_vector

Related Topics


Worldspawn Suns

One method of defining suns is by using Worldspawn settings. The keywords listed in the entries below pertain to the first sun. To create additional suns, just change the keyword prefix from _sun to _sun2, _sun3, _sun4, _sun5, _sun6, _sun7, _sun8, or _sun9. For example: _sun3_light would set the brightness of a 3rd sun, and _sun5_color would set the color for a 5th.


 
 
_sun_color  r g b

location: worldspawn    version: 1.00  
r g b: standard rgb color default: sky surface color

Sets the color of the sunlight to the specified rgb color value. If _sun_color is not specified, the color of the sky surface textures will be used instead.

no example image example map
 

 
 
_sun_diffuse  brightness

location: worldspawn    version: 1.00  
brightness: 0-sunlight brightness default: 0

Sets the brightness of the diffused sunlight. This simulates the diffusion of light by atmospheric haze, creating a soft glow around the edges of sunlight shadows.

no example image example map
 

 
 
_sun_diffade  scale
_sun_difwait  scale

location: worldspawn    version: 1.00  
scale: 0-1 (bigger),  > 1 (smaller) default: 1

Scales how quickly the diffuse sunlight fades out over distance. The default distance is about 64 units. Values less than 1 fade slower, increasing the distance. Values greater than 1 fade faster, decreasing the distance. For example: a value of .5 fades half as fast, covering twice the distance, or about 128 units.

Note: The quality of diffuse sunlight is dependant on patch size. Values greater than 1 may require a smaller -chopsky size to look good.

no example image example map
 

 
 
_sun_light  brightness

location: worldspawn    version: 1.00  
brightness: > 0 default: 200

Sets the brightness of the sunlight. Sunlight is not affected by distance, only by the angle-on-incidence (angle it strikes surfaces).

no example image example map
 

 
 
_sun_style  lightstyle
_sun_style  targetname

location: worldspawn    version: 3.00  
lightstyle: standard lightstyle (0-31)
targetname: targetname of triggered light
default: 0
default: none

Sets the lightstyle that this sun will cast. The value can take one of two possible forms:

lightstyle - A standard 0-31 lightstyle number.

targetname - The targetname of a separate triggered light entity. This will set the sunlight to the same trigger as the light.

Note: Remember only style 0 light bounces.

no example image example map
 

Worldspawn Sun Aiming

Like spotlights, there are several different methods available for setting the direction of suns in the Worldspawn. Choose any one of the methods that you prefer. Remember these point in the direction the sunlight is cast, not towards the sun. All suns points straight down by default.


 
 
_sun_angle  yaw pitch
_sun_mangle  yaw pitch

location: worldspawn    version: 1.00  
yaw: 0-360     pitch: -90-90 default: 0 -90

Sets the sunlight direction by yaw and pitch angles. Yaw goes from 0-360 degrees around the z-axis, like the angle key. Pitch goes from -90 straight down, through 0 horizontal, to 90 straight up.

Note: A value around "75 -30" lines up well with the sun in Quake2's envmap skies.

no example image example map
 

 
 
_sun_target  targetname
_sun  targetname

location: worldspawn    version: 1.00  
targetname: targetname of spotlight's info_null default: none

Sets the sunlight direction with separate light & info_null entities. Create and aim a spotlight using the traditional qrad3 info_null method. Then set the _sun_target value to the same targetname as the info_null. The sun will now point in the same direction as that spotlight.

no example image example map
 

 
 
_sun_vector  x y z

location: worldspawn    version: 1.00  
x y z: any direction default: 0 0 -1

Sets the sunlight direction by direction vector. This is the direction defined by a ray pointing from the origin (0,0,0) to the specified x,y,z value.

no example image example map
 

Related Topics

-chopsky

Sunlight: Light Entity