Previous
LIGHTs
ambient
This light is ambiental, since it does not come from any
particular point or direction. It illuminates all points on all
surfaces.
- string "color", vector3 | pattern color
Specify the color.
It may be a color or a volumetric pattern.
If a pattern is given the color is used as input to it,
so you have to set it too.
conic
The distribution of this light is an oriented cone.
It may be used to simulate spot-lights.
It produces sharp shadows, and since they are ray-traced they may be slow to compute.
- string "color", vector3 color
Specify the color.
- string "position", vector3 position
Specify the position in local coordinates.
- string "direction", vector3 direction
Specify the direction in local coordinates.
- string "angle", float spot, float penumbra
Specify the angular aperture of the cone (in radiants).
It specified with two values, since the first describes an inner cone
where the intensity is constant, and the second describes an
outer cone where the intensity diminishes to zero from the
center to the border.
- string "exponent", float exp
Specify the exponential factor that controls the diminuition
of the intensity inside the penumbra.
The higher this value, the sharper the changes.
The default is 1.
- string "shadows", int switch
Specify if shadows are casted (switch != 0) or not (switch =
0).
The default is 1.
directional
This is an infinitely distant light that comes from a particular
direction.
It may be used to model the distribution of the sun.
It produces sharp shadows, and since they are ray-traced they may be slow to compute.
- string "color", vector3 color
Specify the color.
- string "direction", vector3 direction
Specify the direction in local coordinates.
- string "shadows", int switch
Specify if shadows are casted (switch != 0) or not (switch =
0).
The default is 1.
directional-patch
This is a quadrilateral patch that emits light in one direction only.
It may be used to simulate windows.
It produces sharp shadows, and since they are ray-traced they may be slow to compute.
- string "color", vector3 color
Specify the color.
- string "position", vector3 p1, vector3 p2, vector3 p3, vector3 p4
Specify the position of the patch in local coordinates.
The points are not connected sequentially, but they are
connected in the order: p1, p2, p4, p3.
This order is used to highlight the fact that this is not
necessarily a planar polygon, since it is treated as a
bilinear patch. A bilinear patch is the surface formed
connecting two lines using linear interpolation, in this case
the surface between the lines p1-p2 and p3-p4 (or equivalently
p1-p3 and p2-p4).
Note that the border of this surface is always made by
straight lines, but its interior may be curved. In particular if
the edges are not coplanar it may be a piece of an hyperboloid.
- string "direction", vector3 direction
Specify the direction in local coordinates.
- string "shadows", int switch
Specify if shadows are casted (switch != 0) or not (switch =
0).
The default is 1.
patch
This is a quadrilateral patch that emits light in all directions.
It may be used to simulate neon fixtures.
It produces accurate soft shadows, and since they are ray-traced they may
be very slow to compute, accordingly to the global lighting
settings defined into the "default" interface.
In paticular the most significative values that influence the
time to quality ratio are the "lighting-angle" and the "lighting-threshold".
- string "color", vector3 color
Specify the color.
- string "position", vector3 p1, vector3 p2, vector3 p3, vector3 p4
Specify the position of the patch in local coordinates.
The points are not connected sequentially, but they are
connected in the order: p1, p2, p4, p3.
This order is used to highlight the fact that this is not
necessarily a planar polygon, since it is treated as a
bilinear patch. A bilinear patch is the surface formed
connecting two lines using linear interpolation, in this case
the surface between the lines p1-p2 and p3-p4 (or equivalently
p1-p3 and p2-p4).
Note that the border of this surface is always made by
straight lines, but its interior may be curved. In particular if
the edges are not coplanar it may be a piece of an hyperboloid.
- string "type", string type
Specify if the patch emits light on both sides (type =
"two-sided") or only in the one pointed by the vector product
(p2-p1) x (p3-p1) (type = "one-sided").
The default value is "two-sided".
- string "shadows", int switch
Specify if shadows are casted (switch != 0) or not (switch =
0).
The default is 1.
point
This type spreads light into all directions from an infinitesimal point.
It may be used to simulate light bulbs.
It produces sharp shadows, and since they are ray-traced they may be slow to compute.
- string "color", vector3 color
Specify the color.
- string "position", vector3 position
Specify the position in local coordinates.
- string "shadows", int switch
Specify if shadows are casted (switch != 0) or not (switch =
0).
The default is 1.
soft
This type spreads light into all directions from an infinitesimal point.
It may be used to simulate light bulbs.
It simulates soft shadows using a simple zbuffering technique,
and so it is much faster than real area lights, even if it
produces similar results.
The drawback of this approach is the inability to produce
filtered shadows and volumetric shading.
- string "color", vector3 color
Specify the color.
- string "position", vector3 position
Specify the position in local coordinates.
- string "zbuffer", int size
Specify the size in pixels of the zbuffer.
The larger this value is, the more detailed will be the
shadows, but the precomputation step will take longer times and
higher memory occupancy.
The default value is 256.
- string "radius", float radius
Specify the radius of the filter that is used to blur the
shadows.
This value is expressed as a fraction of the zbuffer size, and
so it should go from 0 to 1.
The greater this value the longer
the computation times.
The default is 0.01.
- string "samples", int samples
Specify the number of samples that are taken from the zbuffer
to compute the blurring filter.
If the shadows look grainy this value should be increased.
The default is 6.
- string "bias", float bias
Specify a biasing value that is used to make the shadows look
less grainy.
This value should not be modified unless the results present
strange streaks. In this case it should be increased.
The default is 0.2.
soft-conic
The distribution of this light is an oriented cone.
It may be used to simulate spot-lights.
It simulates soft shadows using a simple zbuffering technique,
and so it is much faster than real area lights, even if it
produces similar results.
The drawback of this approach is the inability to produce
filtered shadows and volumetric shading.
- string "color", vector3 color
Specify the color.
- string "position", vector3 position
Specify the position in local coordinates.
- string "direction", vector3 direction
Specify the direction in local coordinates.
- string "angle", float spot, float penumbra
Specify the angular aperture of the cone (in radiants).
It specified with two values, since the first describes an inner cone
where the intensity is constant, and the second describes an
outer cone where the intensity diminishes to zero from the
center to the border.
- string "exponent", float exp
Specify the exponential factor that controls the diminuition
of the intensity inside the penumbra.
The higher this value, the sharper the changes.
The default is 1.
- string "zbuffer", int size
Specify the size in pixels of the zbuffer.
The larger this value is, the more detailed will be the
shadows, but the precomputation step will take longer times and
higher memory occupancy.
The default value is 256.
- string "radius", float radius
Specify the radius of the filter that is used to blur the
shadows.
This value is expressed as a fraction of the zbuffer size, and
so it should go from 0 to 1.
The greater this value the longer
the computation times.
The default is 0.01.
- string "samples", int samples
Specify the number of samples that are taken from the zbuffer
to compute the blurring filter.
If the shadows look grainy this value should be increased.
The default is 6.
- string "bias", float bias
Specify a biasing value that is used to make the shadows look
less grainy.
This value should not be modified unless the results present
strange streaks. In this case it should be increased.
The default is 0.2.