Lua API  0.4.0
Game Engine
 All Files Functions
Lights.lua File Reference

Functions

 getLightColor (object)
 Returns the color of the given light source. More...
 
 getLightRadius (object)
 Returns the radius of the given light source. More...
 
 getLightIntensity (object)
 Returns the intensity of the given light source. More...
 
 getLightShadowQuality (object)
 Returns the shadow quality of the given light source. More...
 
 getLightShadowBias (object)
 Returns the bias of the given light source. More...
 
 getLightShadowBlur (object)
 Returns the blur factor of the given light source. More...
 
 getLightSpotAngle (object)
 Returns the spot angle of the given light source. More...
 
 getLightSpotExponent (object)
 Returns the spot exponent of the given light source. More...
 
 setLightColor (object, color)
 Changes the color of the given light source. More...
 
 setLightRadius (object, radius)
 Changes the radius of the given light source. More...
 
 setLightIntensity (object, intensity)
 Changes the intensity of the given light source. More...
 
 setLightShadowQuality (object, quality)
 Changes the shadow quality of the given light source. More...
 
 setLightShadowBias (object, bias)
 Changes the shadow bias of the given light source. More...
 
 setLightShadowBlur (object, blur)
 Changes the shadow blur of the given light source. More...
 
 setLightSpotAngle (object, spotAngle)
 Changes the spot angle of the given light source. More...
 
 setLightSpotExponent (object, exponent)
 Changes the spot exponent of the given light source. More...
 

Function Documentation

getLightColor ( object  )

Returns the color of the given light source.

The color is encoded as a vec3.

Parameters
objectThe light source.
Returns
The color.
getLightIntensity ( object  )

Returns the intensity of the given light source.

Parameters
objectThe light source.
Returns
A number.
getLightRadius ( object  )

Returns the radius of the given light source.

Parameters
objectThe light source.
Returns
A number.
getLightShadowBias ( object  )

Returns the bias of the given light source.

Parameters
objectThe light source.
Returns
A number.
getLightShadowBlur ( object  )

Returns the blur factor of the given light source.

Parameters
objectThe light source.
Returns
A number.
getLightShadowQuality ( object  )

Returns the shadow quality of the given light source.

Parameters
objectThe light source.
Returns
A number.
getLightSpotAngle ( object  )

Returns the spot angle of the given light source.

Parameters
objectThe light source.
Returns
A number.
getLightSpotExponent ( object  )

Returns the spot exponent of the given light source.

Parameters
objectThe light source.
Returns
A number.
setLightColor ( object  ,
color   
)

Changes the color of the given light source.

Parameters
objectThe light source.
colorA vec3 containing the RGB values.
setLightColor(light, {0.5,0.5,0.5})
setLightIntensity ( object  ,
intensity   
)

Changes the intensity of the given light source.

Parameters
objectThe light source.
intensityA number.
setLightRadius ( object  ,
radius   
)

Changes the radius of the given light source.

Parameters
objectThe light source.
radiusA number.
setLightShadowBias ( object  ,
bias   
)

Changes the shadow bias of the given light source.

Parameters
objectThe light source.
biasA number.
setLightShadowBlur ( object  ,
blur   
)

Changes the shadow blur of the given light source.

The shadow blur describes the number of passes the GLSL shader uses to blur the shadow edge. Bigger values might slow down your game!

Parameters
objectThe light source.
blurA number. Keep this as small as possible!
setLightShadowQuality ( object  ,
quality   
)

Changes the shadow quality of the given light source.

The shadow quality is basically the resolution of the texture the depth data will be rendered to. The resolution looks like "quality x quality" and works best if quality is a power of two like 1024 or 2048.

Parameters
objectThe light source.
qualityA number. Works best with a power of two.
setLightSpotAngle ( object  ,
spotAngle   
)

Changes the spot angle of the given light source.

The spot angle describes the angle a spot light is able to illuminate. A point light has an angle > 180° and can be turned into a spot light by setting a smaller spot angle.

Parameters
objectThe light source.
spotAngleA number.
setLightSpotExponent ( object  ,
exponent   
)

Changes the spot exponent of the given light source.

The spot exponent describes the strength of blending out the illuminated area of the spot light on the edges.

Parameters
objectThe light source.
exponentA number.