![]() |
![]() |
![]() |
Sunlight in the original Qrad3 is treated exactly the same as all surface lighting. Light is simply cast out from the sky surfaces in all directions. This type of lighting does not come close to simluating realistic sunlight, expect perhaps for excessively hazy and overcast days.
ArghRad adds new options to simulate realistic directional sunlight. As the name suggests, this is done by casting all rays of light from the sky in a specific direction, rather than from a specific point. This produces more clearly defined areas of light and shadow. ArghRad provides options to diffuse the sunlight a bit, softening out those shadows. It also gives full control over sunlight brightness and color. Last but not least, ArghRad provides all this control for up to four separate sunlight sources. All sunlight options are specified in the map's worldspawn entity. If none of these sunlight options are specified, ArghRad will default to the old Qrad3 style.
Sunlight will only be cast from light-emitting sky surfaces. That means they must have the light flag set, and also have a light value. The actual value is ignored by default, it simply tells ArghRad that sunlight should come from the surface.
One important consideration is to make sure you never have non-sky surfaces on the same plane as your sky surfaces IF they have a clear line of sight to each other. Besides being unrealistic construction, this can cause some areas to be lit incorrectly. As long as their direct line of sight is blocked by other brushes, this is not a problem.
This sets the brightness of the sunlight. Sunlight brightness is not affected by distance, only by the angle it strikes other surfaces. The value should generally fall in the lower hundreds.
Example:
{ "classname" "worldspawn" "_sun_light" "280"
("_sun" and "_sun_target" are identical) This is the first of three different methods you may choose from to aim the sunlight. It is based off of the traditional spotlight aiming method. First, you must create an info_null and give it a "targetname". Next, you create a light entity, and set its "target" to the info_null's "targetname". Then you add the "_sun_target" key to the worldspawn, and set its value to the info_null's "targetname" as well. The direction from the spotlight to the info_null will be the direction of the sunlight. You can move the spotlight or info_null around to visually set the direction of the sunlight. The spotlight itself will still cast light, so if you don't want that then set its brightness to 1.
Example:
{ "classname" "worldspawn" "_sun_light" "280" "_sun_target" "suntarget" ... { "classname" "light" "origin" "128 128 64" "target" "suntarget" "light" "1" } { "classname" "info_null" "origin" "128 64 0" "targetname" "suntarget" }
("_sun_angle" and "_sun_mangle" are indentical) If you prefer not to bother with spotlight and info_null entities, you may wish to use this sunlight aiming method instead. It takes two numbers for its value. The first, yaw, goes from 0 to 360 degrees around the z axis, just like the "angle" value used in many other entities. The second, pitch, is the up/down angle. It goes from -90, straight down, to 90, straight up. These values define the angle the sun will shine. A value near "75 -30" looks particularly good in Quake2, as it lines up well with the sun in Quake2's skies.
Example:
{ "classname" "worldspawn" "_sun_light" "280" "_sun_angle" "75 -30"
The third method of aiming the sun, is by a direction vector. A direction vector is a single x,y,z coordinate that defines an angle pointing from the origin (0,0,0) towards that coordinate. To use this, set the three "_sun_vector" numbers to the vector's x, y, and z values.
Example:
{ "classname" "worldspawn" "_sun_light" "280" "_sun_vector" "2 1 -1"
Use "_sun_color" to specify the color of the sunlight. It takes a standard RGB color value, just like a light's "_color" key. If there is no "_sun_color", ArghRad will use the color of the sky surface instead.
Example:
{ "classname" "worldspawn" "_sun_light" "280" "_sun_color" "1 .75 .5"
Sometimes it is desirable to soften the harsh shadows resulting from the sunlight. "_sun_diffuse" can be used to simulate the diffusion of light caused by atmospheric haze. This softens those shadows by letting light "spill over" the edges into the shade. Set the "_sun_diffuse" value to the desired brightness of the diffuse light. ArghRad will not allow this value to exceed the sunlight brightness.
Example:
{ "classname" "worldspawn" "_sun_light" "280" "_sun_diffuse" "200"
If you want to alter the distance that it takes for diffuse light to fade, you can use "_sun_difwait" or "_sun_diffade" (both options are identical). The value works similar to a light's "_fade" key. A value greater than 1 will make the light fade out faster, while a value less than 1 will slow the rate of fade. For example, a value of .5 would make the diffuse light fade half as fast (go twice as far). Note that the quality of diffuse lighting is linked to patch size, so values greater than 1 may look bad unless you decrease the -chopsky value.
Example:
{ "classname" "worldspawn" "_sun_light" "280" "_sun_diffuse" "200" "_sun_diffade" "1.75"
ArghRad supports up to four individual sunlight sources. That should be plenty for any typical alien homeworld. ;) Defining them is easy. Any of the sunlight options above can be used (the "_sun_ambient" option below can not). Instead of starting the keywords with "_sun", you just substitue "_sun2", "_sun3", or "_sun4". For example, instead of "_sun_light", you would use "_sun2_light" to set the brightness of the 2nd sun.
This sunlight option involves a type of ambient lighting. This ambient sunlight value will be added to all points that can see any lit sky surfaces, even if the actual sunlight does not shine there. This is generally used to brighten up the sun's shadows. Low "_sun_ambient" values tend to look the most natural, as high values generate prominant, unrealistic light/shadows. The color of the ambient lighting will be derived from the color of all of the suns.
Example:
{ "classname" "worldspawn" "_sun_ambient" "20"
This special alternate form allows you to explicitly specify the ambient sunlight color. The value is specified as three separate brightnesses: red, green, and blue, respectively. It is NOT an RGB color value, it is three separate brightness values.
Example:
{ "classname" "worldspawn" "_sun_ambient" "20 10 0"
This final option allows both sunlight and normal surface light to come from the sky surfaces. The value specified is the brightness of the surface light to cast. Like "_sun_ambient", the color of the lighting will be derived from the color of all of the suns. A value of 1 is a special value which makes ArghRad use the brightness values of the individual faces instead (like normal surface lighting).
Example:
{ "classname" "worldspawn" "_sun_surface" "300"
This alternate form allows you to explicitly specify the surface light color. This works in two different ways. If all three values are greater than 1, then they will be treated like three separate brightnesses: red, green, and blue respectively (NOT an RGB color). If all thee values are less than or equal to 1, then ArghRad does consider it an RGB color, and uses the brightness values of the individual faces (like normal surface lighting).
Example:
{ "classname" "worldspawn" "_sun_ambient" "250 200 100"