[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide Host-API Lua / Python
» Back to Homepage
» Back to Developer's Guide Index
HYP_Lighting Library
Curve library
Number of functions: 17
HYP_Lighting.Create
Creates a new light object.
: Lua - Python
lightId [INTEGER]: light identifier
:
lightId = HYP_Lighting.Create()
HYP_Lighting.Destroy
Destroys an existing light object.
: Lua - Python
lightId [INTEGER]: light identifier
:
HYP_Lighting.Destroy(lightId)
HYP_Lighting.SetAmbient
Sets light's ambient component.
: Lua - Python
lightId [INTEGER]: light identifier
r, g, b, a [REAL]: RGBA ambient channels.
:
HYP_Lighting.SetAmbient(lightId, 0.2, 0.2, 0.2, 1.0)
HYP_Lighting.GetAmbient
Gets light's ambient component.
: Lua - Python
lightId [INTEGER]: light identifier
r, g, b, a [REAL]: RGBA ambient channels.
:
r, g, b, a = HYP_Lighting.GetAmbient(lightId)
HYP_Lighting.SetDiffuse
Sets light's diffuse component.
: Lua - Python
lightId [INTEGER]: light identifier
r, g, b, a [REAL]: RGBA diffuse channels.
:
HYP_Lighting.SetDiffuse(lightId, 0.8, 0.8, 0.8, 1.0)
HYP_Lighting.GetDiffuse
Gets light's diffuse component.
: Lua - Python
lightId [INTEGER]: light identifier
r, g, b, a [REAL]: RGBA diffuse channels.
:
r, g, b, a = HYP_Lighting.GetDiffuse(lightId)
HYP_Lighting.SetSpecular
Sets light's specular component.
: Lua - Python
lightId [INTEGER]: light identifier
r, g, b, a [REAL]: RGBA specular channels.
:
HYP_Lighting.SetSpecular(lightId, 0.9, 0.9, 0.6, 1.0)
HYP_Lighting.GetSpecular
Gets light's specular component.
: Lua - Python
lightId [INTEGER]: light identifier
r, g, b, a [REAL]: RGBA specular channels.
:
r, g, b, a = HYP_Lighting.GetSpecular(lightId)
HYP_Lighting.ApplyToRenderer
Applies light properties to the renderer. This function is useful with render to texture or in direct rendering scripts.
: Lua - Python
lightId [INTEGER]: light identifier
:
HYP_Lighting.ApplyToRenderer(lightId)
HYP_Lighting.SetConstantAttFactor
Changes the value of the light constant attenuation factor proportionately to the distance from the vertex being currently processed.
: Lua
lightId [INTEGER]: light identifier
att [REAL]: attenuation factor
:
HYP_Lighting.SetConstantAttFactor(lightId, 0.5)
HYP_Lighting.SetLinearAttFactor
Changes the value of the light linear attenuation factor proportionately to the distance from the vertex being currently processed.
: Lua
lightId [INTEGER]: light identifier
att [REAL]: attenuation factor
:
HYP_Lighting.SetLinearAttFactor(lightId, 0.01)
HYP_Lighting.SetQuadraticAttFactor
Changes the value of the light quadratic attenuation factor proportionately to the distance from the vertex being currently processed.
: Lua
lightId [INTEGER]: light identifier
att [REAL]: attenuation factor
:
HYP_Lighting.SetQuadraticAttFactor(lightId, 0.0001)
HYP_Lighting.SetSpotCutOff
Sets the aperture angle of light's cone in case of a spot light.
: Lua
lightId [INTEGER]: light identifier
angle [REAL]: angle in degrees of the light cone aperture.
:
HYP_Lighting.SetSpotCutOff(lightId, 30.0)
HYP_Lighting.GetSpotCutOff
Gets the aperture angle of light's cone in case of a spot light.
: Lua
lightId [INTEGER]: light identifier
angle [REAL]: angle in degrees of the light cone aperture.
:
angle = HYP_Lighting.GetSpotCutOff(lightId)
HYP_Lighting.GetNumLights
Returns the number of existing lights (XML or script).
: Lua
n [INTEGER]: number of lights.
:
n = HYP_Lighting.GetNumLights()
HYP_Lighting.GetIdByIndex
Returns a light ight according to its position in the lights list.
: Lua
lightIndex [INTEGER]: light index. Range: [0 to GetNumLights()-1]
lightId [INTEGER]: light identifier.
:
lightId = HYP_Lighting.GetIdByIndex(0)
HYP_Lighting.SetShadowEmitterState
Allows to specify whether a light is a source for shadow or not.
: Lua
lightId [INTEGER]: light identifier
state [INTEGER]: state: 1 or 0.
:
HYP_Lighting.SetShadowEmitterState(lightId, 0);
|