Shader: "spot"

"spot"

ClassLight
Synopsis Light from a spot source constrained to a cone.
Arguments

"intensity" Type: LtFloat
Default:1.0
Range:[ 0, inf ]
Hint:-
"intensity units" Type: LtEnum
Default:LI_INTEN_UNITS_EMPIRICAL
Range: 0, 1, 2, 3, 4
Hint:-
"colour" Type: LtColour
Default:(1.0, 1.0, 1.0)
Range: [ 0, inf ], [ 0, inf ], [ 0, inf ]
Hint: [ 0, 1 ], [ 0, 1 ], [ 0, 1 ]
"colour temperature" Type: LtFloat
Default:0.0
Range:[ 0, 50000 ]
Hint:[ 150, 50000 ]
"location" Type: LtPoint
Default:(0.0, 0.0, 1.0)
Range: [ -inf, inf ], [ -inf, inf ], [ -inf, inf ]
Hint:-
"to" Type: LtPoint
Default:(0.0, 0.0, 0.0)
Range: [ -inf, inf ], [ -inf, inf ], [ -inf, inf ]
Hint:-
"fall off" Type: LtFallOff
Default:LI_FALL_OFF_CONSTANT
Range: 1, 2, 3, 4, 5
Hint:-
"cone angle" Type: LtFloat
Default:60.0
Range:[ 0, 179 ]
Hint:[ 1, 179 ]
"cone delta angle" Type: LtFloat
Default:5.0
Range:[ 0, 89.5 ]
Hint:[ 1, 20 ]
"beam distribution" Type: LtFloat
Default:2.0
Range:[ 0, inf ]
Hint:[ 0, 5 ]
"shadows" Type: LtBoolean
Default:FALSE
Range:-
Hint:-
"shadow type" Type: LtEnum
Default:LI_SHADOW_TYPE_SOFT
Range: 1, 2
Hint:-
"shadow transparency" Type: LtBitfield
Default:LI_TRANS_SHADOW_GLOBAL
Range: 15
Hint:-
"shadow acceleration" Type: LtBitfield
Default:LI_SHADOW_ACC_NONE
Range: 31
Hint:-
"shadow resolution" Type: LtInt32
Default:256
Range:[ 0, 8000 ]
Hint:[ 50, 2048 ]
"shadow quality" Type: LtInt32
Default:4
Range:[ 1, 16 ]
Hint:[ 4, 9 ]
"shadow softness" Type: LtFloat
Default:1.0
Range:[ 0.1, 20 ]
Hint:[ 1, 4 ]
"shadow tolerance" Type: LtFloat
Default:0.0
Range:[ 0, 1 ]
Hint:[ 0, 0.1 ]
"scattering" Type: LtBoolean
Default:FALSE
Range:-
Hint:-
Locationlishslte
Description A light source emitting light from a single point and constrained to a cone. The position of the light is specified by means of argument "location", and the direction of the axis of the cone points from this position to the point specified by argument "to". The intensity of the light can be specified in either non-physical, `empirical' units (essentially an arbitrary value chosen by the user to produce an image which looks right), or by physically accurate units of light intensity (such as lux or candela) as used by the lighting industry.

The argument "intensity units" is used to specify what units the argument "intensity" is given in. By default the units are assumed to be empirical (arbitrary) units. The full list of possible values for "intensity units" for this light shader is:

  • LI_INTEN_UNITS_EMPIRICAL---Intensity specified in arbitrary empirical units (the default)

  • LI_INTEN_UNITS_CANDELA---Intensity specified in Candelas

  • LI_INTEN_UNITS_KILOCANDELA---Intensity specified in Kilocandelas

  • LI_INTEN_UNITS_LUMEN---Intensity specified in Lumens

  • LI_INTEN_UNITS_KILOLUMEN---Intensity specified in Kilolumens

There are also two ways to specify the colour of the light. Either the more intuitive "colour" argument can be used (which is simply an LtColour value), or the "colour temperature" argument may be used instead if you are attempting to accurately model some real-world light (many lighting manufacturers publish the performance of their light fittings in such a way). Further details of what is meant by a colour temperature can be found in the LightWorks manual `Lighting'. The value itself is given as an LtFloat representing a temperature value in Kelvins. A number of standard values are defined as symbols, and the default value, 0.0, means that the standard "colour" argument is used instead. Similarly, if the "colour" argument is left at its default value of (1.0, 1.0, 1.0) (white) then it will be ignored and the "colour temperature argument" used to decide the light's colour.

If non-default values are provided for both "colour" and "colour temperature" arguments, note that the final colour of the light will be calcalated by combining the two values.

An argument "fall off" is provided which may be used to indicate the way in which the intensity of light emanating from the point varies with distance from the point. It can either be constant ( LI_FALL_OFF_CONSTANT), inverse ( LI_FALL_OFF_INVERSE) or inverse square ( LI_FALL_OFF_ISL), unclamped inverse ( LI_FALL_OFF_INVERSE_NO_CLAMP), or unclamped inverse square ( LI_FALL_OFF_ISL_NO_CLAMP). If fall off is set to constant the light intensity does not vary with distance from the source. If fall off is set to inverse the light intensity varies with the inverse of the distance from the source. If fall off is set to inverse square the light intensity varies with the inverse squared distance from the source.

The angle of the cone within which light is emitted from the light source is specified in degrees by the value passed as argument "cone angle" (a full angle), and the angular distance over which the intensity of the light diminishes is specified by argument "cone delta angle" (a half angle). This angle is measured from "cone angle" and towards the axis, and is specified such that the intensity is varied from the computed value at the angle 0.5 × "cone angle" - "cone delta angle" to zero at angle 0.5 × "cone angle". The variation of the intensity of the light from the axis of the cone outwards may be set with the argument "beam distribution". A value of 0.0 for this argument causes uniform intensity across the interior of the beam, and the higher the value, the faster the intensity diminishes with the angle.

The argument "shadow type" is used to specify whether hard-edged shadows (produced by ray casting) or soft-edged shadows (produced by shadow mapping) are created. Note that because hard-edged shadows require the ray tracer, they are only available to users of LightWorks~Classic or above. Therefore by default the value of this parameter is LI_SHADOW_TYPE_SOFT. If hard-edged shadows are required, and the ray tracer is available to you, then the value LI_SHADOW_TYPE_HARD should be used.

Note: Soft shadows require a shadow map to be calculated. This step must be explicitly carried out by the application, by calling LiLightCreateShadow.

It is possible now to control transparency of shadows on per light basis, using the "shadow transparency" argument.

The default value, LI_TRANS_SHADOW_GLOBAL, means that the global setting from LI_CONTROL_TRANSPARENT_SHADOW is used for this light. However you can override the value of this global control variable by setting the light argument to one of the following values:

  • LI_TRANS_SHADOW_ON
  • LI_TRANS_SHADOW_INTERPOLATE
  • LI_TRANS_SHADOW_DISPLACEMENT

It is also possible to make use of a previously generated shadow map to speed up calculation of hard-edged (ray cast) shadows. In order to do this, the "shadow acceleration" argument should be set to LI_SHADOW_ACC_MAPS. By default this argument is set to LI_SHADOW_ACC_NONE, meaning no such acceleration is performed.

The resolution of the shadow map that is used in the preprocessing of shadows is passed in argument "shadow resolution".

Shadows may be turned on for the light source by means of the flag passed as argument "shadows", a value of TRUE being used to turn shadows on. {Note that shadows can only be displayed if the "shadows" argument is set to TRUE and either ray cast shadows are being used or the shadow maps have been preprocessed.}

The quality of the shadows is specified by "shadow quality": a value of 1 corresponds to low quality, and a larger value such as 9 gives higher quality.

A value that determines how soft the boundaries of shadows appear is specified in argument "shadow softness".

The "shadow tolerance" value is used to modify the shadow map sampling distance. It used to deal with self shadowing artifacts that can be apparent with low resolution, high softness shadows. They usually appear as either grid like patterns of smudges or moire patterns.

A value of 0.0 specifies no effect, a value of 1.0 causes no shadows. Values of around 0.1 to 0.2 are usually sufficient to deal with most artifacts. The value of this parameter should be as small as possible. The reason for this is that large values can cause shadows to disappear from objects close to the object casting the shadow. A value of 1.0 will cause all shadows to vanish. For more details see the Lighting manual.

If the light is to be used in conjunction with either the "fog light" or "scattering medium" shaders to create the effect of light being scattered by a foggy atmosphere, then the parameter "scattering" must be set to TRUE (it is FALSE by default for efficiency reasons).

Previous page alphabetically (spherical)
Next page alphabetically (stipple)
Index


Copyright © 1990-2005, 2006 LightWork Design Limited. All rights reserved