Light - stingray.Light object reference - Stingray Lua API Reference

stingray.Light object reference

Description

Describes a game light.

Functions

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

Returns true if the light is tagged for baking, and false otherwise.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

Returns true if the light casts shadows, and false otherwise.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Vector3

The color of the light. The values for the X, Y and Z axes indicate the red, green, and blue color channels respectively; each is a value in linear space between 0 and 1.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

number

The distance at which the light has reached zero intensity.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

number

The distance at which the light starts to lose its intensity.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

number

The intensity of the light.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

enabled :

boolean

Use true to remove light from realtime rendering path.

Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

enabled :

boolean

Use true to enable shadow casting, or false to disable.

Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

color :

stingray.Vector3

The color to set for the light. The values for the X, Y and Z axes indicate the red, green, and blue color channels respectively; each should be a value in linear space between 0 and 1.

Returns
This function does not return any values.
Parameters

unit :

stingray.Unit

The game unit that the destination light is part of.

src :

stingray.Light

The source light whose data is copied over.

dst :

stingray.Light

The destination light that will receive the data.

Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

enabled :

boolean

Use true to enable the light, or false to disable.

Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

distance :

number

The distance at which the light should reach zero intensity.

Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

distance :

number

The distance at which the light should start to lose its intensity.

Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

intensity :

number

The intensity to set for the light.

Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

value :

number

Shadow depth bias value to use when rendering shadow maps (0-1 range).

Returns
This function does not return any values.

A too low value causes shadow acne, a too high value causes peter panning.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

spot_angle_end :

number

The new cone angle, in radians.

Returns
This function does not return any values.

Valid only for spot lights.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

spot_angle_start :

number

The new cone angle, in radians.

Returns
This function does not return any values.

Valid only for spot lights.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

type :

string

The type of the light source. Valid input values are:

  • omni: Radiates light in all directions.
  • spot: A focused beam of light from a single point source.
  • box: Radiates light from a single inner face of a box volume.
  • directional: Parallel light rays.
Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

number

Returns user specified shadow depth bias (0-1 range).

A too low value causes shadow acne, a too high value causes peter panning.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

number

The cone angle, in radians.

Valid only for spot lights.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

number

The cone angle, in radians.

Valid only for spot lights.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

string

The type of the light source. Can be any of :omni, spot, box or directional.

Scene placement

The functions in this group control the placement of an object of this type in the scene.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Matrix4x4

The position and orientation of the object in local space.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Vector3

The position of the object in local space.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Quaternion

The rotation of the object in local space.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

integer

The ID of the specified object in the scene graph.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

parent :

stingray.Unit

The parent Unit that owns this object.

pose :

stingray.Matrix4x4

The new position and orientation for the object in local space.

Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

parent :

stingray.Unit

The parent Unit that owns this object.

position :

stingray.Vector3

The new position for the object in local space.

Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

parent :

stingray.Unit

The parent Unit that owns this object.

rotation :

stingray.Quaternion

The new rotation for the object in local space.

Returns
This function does not return any values.
Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Matrix4x4

The position and orientation of the object in world space.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Vector3

The position of the object in world space.

Parameters

self :

stingray.Light

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Quaternion

The rotation of the object in world space.