#include "beastapitypes.h"
The api for specifying light sources in beast.
Typedefs | |
typedef uint32 | ILBLightStatsMask |
Enumerations | |
enum | ILBFalloffType { ILB_FO_EXPONENT = 0, ILB_FO_MAX_RANGE, ILB_FO_POLYNOMIAL } |
enum | ILBLightStatOperation { ILB_LSOP_DISABLE, ILB_LSOP_ENABLE, ILB_LSOP_SET } |
enum | ILBLightStats { ILB_LS_VISIBLE_FOR_EYE = 0x00000001, ILB_LS_VISIBLE_FOR_REFLECTIONS = 0x00000002, ILB_LS_VISIBLE_FOR_REFRACTIONS = 0x00000004, ILB_LS_VISIBLE_FOR_GI = 0x00000008 } |
enum | ILBLightType { ILB_LST_DIRECTIONAL = 0, ILB_LST_POINT, ILB_LST_AREA, ILB_LST_SPOT, ILB_LST_WINDOW, ILB_LST_SKY, ILB_LST_AMBIENT } |
enum | ILBLightVolumeType { ILB_LVT_INFINITY = 0, ILB_LVT_SPHERE, ILB_LVT_CUBE } |
typedef uint32 ILBLightStatsMask |
Type representing multiple light stats.
Combine light stats using the or operator (|).
Example:
ILBLightStatsMask lsMask = ILB_LS_VISIBLE_FOR_EYE | ILB_LS_VISIBLE_FOR_GI;
enum ILBFalloffType |
Describes different falloff for light sources.
enum ILBLightStats |
Status bit masks for light sources.
enum ILBLightType |
enum ILBLightVolumeType |
ILBStatus ILBAddLightLightLinks | ( | ILBLightHandle | light, |
ILBLightLinkMode | mode, | ||
const ILBInstanceHandle * | instances, | ||
int32 | count | ||
) |
Adds a light centric light link list.
light | the light source to add light links to |
mode | sets whether to link or unlink the light to the instances |
instances | an array of instances to link to the light |
count | the number of instances present in the instances array |
ILBStatus ILBChangeLightType | ( | ILBLightHandle | light, |
ILBLightType | newType, | ||
ILBLightHandle * | newHandle | ||
) |
Changes the type of a light source.
Retains basic parameters like transform and color but all light type specific parameters are reset to default.
light | the light to change type |
newType | |
newHandle |
ILBStatus ILBCreateAmbientLight | ( | ILBSceneHandle | scene, |
ILBConstString | name, | ||
const ILBMatrix4x4 * | transform, | ||
const ILBLinearRGB * | intensity, | ||
ILBLightHandle * | light | ||
) |
Add an ambient light to the scene.
It illuminates the whole scene by default, but this can be altered by setting a light volume type to the light. Use the light transform matrix to change the position and size of the light volume.
scene | the scene the ambient light should be a part of |
name | the name of the ambient light, must be unique within the scene. |
transform | the object space to world space transform for the light |
intensity | the colored intensity of the light source |
light | the handle to store the generated light source in |
ILBStatus ILBCreateAreaLight | ( | ILBSceneHandle | scene, |
ILBConstString | name, | ||
const ILBMatrix4x4 * | transform, | ||
const ILBLinearRGB * | intensity, | ||
ILBLightHandle * | light | ||
) |
Add an area light to the scene It points in negative Y direction by default, use the matrix to change its direction.
The area light extends -1.0 to 1.0 in the X/Z dimensions, use scaling to control its area
scene | the scene the light should be a part of |
name | the name of the light, must be unique within the scene. |
transform | the object space to world space transform for the light. It controls the area of the light as well. |
intensity | the colored intensity of the light source |
light | the handle to store the generated light source in |
ILBStatus ILBCreateDirectionalLight | ( | ILBSceneHandle | scene, |
ILBConstString | name, | ||
const ILBMatrix4x4 * | transform, | ||
const ILBLinearRGB * | intensity, | ||
ILBLightHandle * | light | ||
) |
Add a directional light to the scene It points in negative Y direction by default, use the matrix to change its direction.
scene | the scene the directional light should be a part of |
name | the name of the directional light, must be unique within the scene. |
transform | the object space to world space transform for the light. |
intensity | the colored intensity of the light source |
light | the handle to store the generated light source in |
ILBStatus ILBCreatePointLight | ( | ILBSceneHandle | scene, |
ILBConstString | name, | ||
const ILBMatrix4x4 * | transform, | ||
const ILBLinearRGB * | intensity, | ||
ILBLightHandle * | light | ||
) |
Add a point light to the scene.
scene | the scene the point light should be a part of |
name | the name of the point light, must be unique within the scene. |
transform | the object space to world space transform for the light |
intensity | the colored intensity of the light source |
light | the handle to store the generated light source in |
ILBStatus ILBCreateSkyLight | ( | ILBSceneHandle | scene, |
ILBConstString | name, | ||
const ILBMatrix4x4 * | transform, | ||
const ILBLinearRGB * | intensity, | ||
ILBLightHandle * | light | ||
) |
Add a sky light to the scene It illuminates the whole scene by default, but this can be altered by setting a light volume type to the sky light.
Use the light transform matrix to change the position and size of the light volume.
scene | the scene the light should be a part of |
name | the name of the light, must be unique within the scene. |
transform | the object space to world space transform for the light. It controls the light volume of the light as well |
intensity | the colored intensity of the light source |
light | the handle to store the generated light source in |
ILBStatus ILBCreateSpotLight | ( | ILBSceneHandle | scene, |
ILBConstString | name, | ||
const ILBMatrix4x4 * | transform, | ||
const ILBLinearRGB * | intensity, | ||
ILBLightHandle * | light | ||
) |
Add a spot light to the scene.
It points in the negative Y-direction by default, use the matrix to point it in a different direction. The default cone angle is 90 degrees.
scene | the scene the light should be a part of |
name | the name of the light, must be unique within the scene. |
transform | the object space to world space transform for the light. |
intensity | the colored intensity of the light source |
light | the handle to store the generated light source in |
ILBStatus ILBCreateWindowLight | ( | ILBSceneHandle | scene, |
ILBConstString | name, | ||
const ILBMatrix4x4 * | transform, | ||
const ILBLinearRGB * | intensity, | ||
ILBLightHandle * | light | ||
) |
Add a window light to the scene It points in negative Y direction by default, use the matrix to change its direction.
The window light extends -1.0 to 1.0 in the X/Z dimensions, use scaling to control its area
scene | the scene the light should be a part of |
name | the name of the light, must be unique within the scene. |
transform | the object space to world space transform for the light. It controls the area of the light as well |
intensity | the colored intensity of the light source |
light | the handle to store the generated light source in |
ILBStatus ILBDeleteLightSource | ( | ILBLightHandle | light | ) |
Deletes a light source from a scene.
Only possible for dynamic scenes, ie. scenes associated with a live ernst job.
light | light to delete |
ILBStatus ILBGetClippingPlanes | ( | ILBLightHandle | light, |
float * | nearDistance, | ||
float * | farDistance | ||
) |
Gets distance to spotlight clipping planes.
Both light shading and shadow casting is clipped by these planes but attenuation is still calculated from light source position.
Only works for spot lights.
light | the light source to get clipping distances for |
nearDistance | the distance to near clipping plane |
farDistance | the distance to far clipping plane |
ILBStatus ILBGetLightCastShadows | ( | ILBLightHandle | light, |
ILBBool * | castShadows | ||
) |
Returns whether a light source cast shadows.
This is used for lights returned from an Ernst session.
light | the light to check shadow status |
castShadows | is set to true if light source cast shadows, false otherwise |
ILBStatus ILBGetLightColor | ( | ILBLightHandle | light, |
ILBLinearRGB * | color | ||
) |
Gets the color of a light source.
This is used for lights returned from an Ernst session.
light | the light to get the color for |
color | the returned light color |
ILBStatus ILBGetLightDisplayName | ( | ILBLightHandle | light, |
ILBStringHandle * | displayName | ||
) |
Gets the display name of a light source.
Display names are not unique within the scene and should only be used by tools to give human understandable names to objects This is used for lights returned from an Ernst session.
light | the light to get the name for |
displayName | the returned light display name |
ILBStatus ILBGetLightExponentFalloff | ( | ILBLightHandle | light, |
float * | cutoff, | ||
float * | exponent, | ||
ILBBool * | clamp | ||
) |
Returns the falloff parameters from a light source with Exponent falloff.
This is used for lights returned from an Ernst session.
light | the light to get shadow samples |
cutoff | the falloff cutoff |
exponent | the falloff exponent |
clamp | sets whether to clamp the falloff to be lower or equal to one. If set to false, the falloff is allowed to scale the intensity of the light up as well as down. |
ILBStatus ILBGetLightFalloffType | ( | ILBLightHandle | light, |
ILBFalloffType * | type | ||
) |
Returns the falloff type from a light source.
This is used for lights returned from an Ernst session.
light | the light to get shadow samples |
type | the returned falloff type |
ILBStatus ILBGetLightIntensity | ( | ILBLightHandle | light, |
float * | intensity | ||
) |
Gets light intensity for a light source.
This is used for lights returned from an Ernst session.
light | the light source to get intensity from |
intensity | the light intensity |
ILBStatus ILBGetLightIntensityScale | ( | ILBLightHandle | light, |
float * | directScale, | ||
float * | indirectScale | ||
) |
Gets scale for direct and indirect light intensity for a light source.
This is used for lights returned from an Ernst session.
light | the light source to get intensities |
directScale | direct light intensity scale |
indirectScale | indirect light intensity scale |
ILBStatus ILBGetLightMaxRangeFalloff | ( | ILBLightHandle | light, |
float * | cutoff, | ||
float * | exponent | ||
) |
Returns the falloff parameters from a light source with MaxRange falloff.
This is used for lights returned from an Ernst session.
light | the light to get shadow samples |
cutoff | the falloff cutoff |
exponent | the falloff exponent |
ILBStatus ILBGetLightName | ( | ILBLightHandle | light, |
ILBStringHandle * | name | ||
) |
Gets the name of a light source.
This is used for lights returned from an Ernst session.
light | the light to get the name for |
name | the returned light name |
ILBStatus ILBGetLightPolynomialFalloff | ( | ILBLightHandle | light, |
float * | cutoff, | ||
float * | constant, | ||
float * | linear, | ||
float * | quadratic, | ||
ILBBool * | clamp | ||
) |
Returns the falloff parameters from a light source with Polynomial falloff.
This is used for lights returned from an Ernst session.
light | the light to get shadow samples |
cutoff | the falloff cutoff |
constant | the falloff constant factor |
linear | the falloff linear factor |
quadratic | the falloff quadratic factor |
clamp | sets whether to clamp the falloff to be lower or equal to one. If set to false, the falloff is allowed to scale the intensity of the light up as well as down. |
ILBStatus ILBGetLightShadowSamples | ( | ILBLightHandle | light, |
int32 * | shadowSamples | ||
) |
Returns the number of shadow samples a light source will use.
This is used for lights returned from an Ernst session.
light | the light to get shadow samples |
shadowSamples | the number of shadow samples |
ILBStatus ILBGetLightStats | ( | ILBLightHandle | light, |
ILBLightStatsMask | stats, | ||
ILBLightStatsMask * | result | ||
) |
Query light stats for a light source.
light | the light source to get light stats from. |
stats | the stats to query. Can be multiple light stats or:ed together. |
result | the result of the query. A bitwise AND operation is done on the individual stats. given stats are true the result is true, and false otherwise. |
ILBStatus ILBGetLightTransform | ( | ILBLightHandle | light, |
ILBMatrix4x4 * | transform | ||
) |
Gets the transform of a light source.
This is used for lights returned from an Ernst session.
light | the light to get the transform for |
transform | the returned light transform |
ILBStatus ILBGetLightType | ( | ILBLightHandle | light, |
ILBLightType * | type | ||
) |
Gets the type of a light source.
This is used for lights returned from an Ernst session.
light | the light to get the type for |
type | the returned light type |
ILBStatus ILBGetLightVolumeType | ( | ILBLightHandle | light, |
ILBLightVolumeType * | type | ||
) |
Gets light volume type for a light source.
Only valid for ambient lights and sky lights. This is used for lights returned from an Ernst session.
light | light to set light volume type on |
type | the volume type to use |
ILBStatus ILBGetShadowAngle | ( | ILBLightHandle | light, |
float * | angleRadians | ||
) |
Gets the angle covered of the sky for a directional light or window light for shadow casting purposes.
This is used for lights returned from an Ernst session.
light | the light source to get the radius on. |
angleRadians | the angle in radians. |
ILBStatus ILBGetShadowRadius | ( | ILBLightHandle | light, |
float * | radius | ||
) |
Gets a radius for the light source as a shadow caster.
Only valid for point and spot lights. This is used for lights returned from an Ernst session.
light | the light source to get the radius on. |
radius | the radius. |
ILBStatus ILBGetSkyLightTexture | ( | ILBLightHandle | light, |
ILBTextureHandle * | texture | ||
) |
Gets a texture from a sky light.
Only valid for sky lights This is used for lights returned from an Ernst session.
light | light to get texture from |
texture | the texture handle |
ILBStatus ILBGetSkyLightTextureFilter | ( | ILBLightHandle | light, |
float * | filter | ||
) |
Gets texture filter size from a sky light.
Only valid for sky lights This is used for lights returned from an Ernst session.
light | light to get filter size from |
filter | the filter size |
ILBStatus ILBGetSkyLightVolumeType | ( | ILBLightHandle | light, |
ILBLightVolumeType * | type | ||
) |
Gets light volume type for a sky light.
Only valid for sky lights This is used for lights returned from an Ernst session.
light | light to set light volume type on |
type | the volume type to use |
ILBStatus ILBGetSpotlightCone | ( | ILBLightHandle | light, |
float * | angleRadians, | ||
float * | penumbraAngleRadians, | ||
float * | penumbraExponent | ||
) |
Gets the cone angle for a spotlight.
The cone is given in radians for the entire cone (as opposed to the angle towards the forward direction). The penumbra angle is the angle from the edge of the cone over which the intensity falls off to zero. The effective spread of the cone is max( angleRadians, angleRadians + 2*penumbraAngleRadians ) since the penumbra angle can be both positive and negative. This is used for lights returned from an Ernst session.
light | the light source to get cone angle for |
angleRadians | the angle in radians for the cone |
penumbraAngleRadians | the angle of the penumbra of the spot light. It's given as the difference from the cone angle and can be both negative and positive. |
penumbraExponent | the exponent for the gradient in the penumbra |
ILBStatus ILBSetCastShadows | ( | ILBLightHandle | light, |
ILBBool | castShadows | ||
) |
Flags whether the light cast shadows or not.
Enabled by default
light | the light source in question. |
castShadows | sets if shadow casting should be enabled or not |
ILBStatus ILBSetClippingPlanes | ( | ILBLightHandle | light, |
float | nearDistance, | ||
float | farDistance | ||
) |
Sets distance to spotlight clipping planes.
Both light shading and shadow casting is clipped by these planes but attenuation is still calculated from light source position.
Only works for spot lights.
light | the light source to set clipping distances for |
nearDistance | the distance to near clipping plane |
farDistance | the distance to far clipping plane |
ILBStatus ILBSetFalloff | ( | ILBLightHandle | light, |
ILBFalloffType | type, | ||
float | exponent, | ||
float | cutoff, | ||
ILBBool | clampToOne | ||
) |
Sets the falloff for a light source.
Not valid for directional lights, sky lights and ambient lights. By default falloff is disabled. By default clamping is enabled.
light | the light source to set falloff for |
type | the falloff type to use |
exponent | sets the exponent for the falloff |
cutoff | sets the influence range for the light source. It affects both falloff types, for exponent it's a hard cutoff where the light stops affecting at all. For max range it sets where the light intensity fades to zero |
clampToOne | sets whether to clamp the falloff to be lower or equal to one. If set to false, the falloff is allowed to scale the intensity of the light up as well as down. |
ILBStatus ILBSetIntensityScale | ( | ILBLightHandle | light, |
float | directScale, | ||
float | indirectScale | ||
) |
Sets scale for direct and indirect light intensity for a light source.
light | the light source to set intensities |
directScale | direct light intensity scale |
indirectScale | indirect light intensity scale |
ILBStatus ILBSetLightColor | ( | ILBLightHandle | light, |
const ILBLinearRGB * | color | ||
) |
Sets the color for a light source.
light | the light source to change |
color | the new color |
ILBStatus ILBSetLightDisplayName | ( | ILBLightHandle | light, |
ILBConstString | displayName | ||
) |
Sets the display name for the light source.
This name does not have to be unique within the scene and can be used by tools to give human understandable names to objects that has names that are generated and for some reason isn't suitable to read
light | the light to set the name for |
displayName | the display name to set |
ILBStatus ILBSetLightExponentFalloff | ( | ILBLightHandle | light, |
float | cutoff, | ||
float | exponent, | ||
ILBBool | clampToOne | ||
) |
Sets the falloff to type "Exponent" for a light source.
Not valid for directional lights, sky lights and ambient lights. By default falloff is disabled. By default clamping is enabled.
light | the light source to set falloff for |
cutoff | hard cutoff range where the light stops affecting at all. |
exponent | sets the exponent for the falloff |
clampToOne | sets whether to clamp the falloff to be lower or equal to one. If set to false, the falloff is allowed to scale the intensity of the light up as well as down. |
ILBStatus ILBSetLightIntensity | ( | ILBLightHandle | light, |
float | intensity | ||
) |
Sets light intensity for a light source.
light | the light source to set intensity |
intensity | the light intensity |
ILBStatus ILBSetLightMaxRangeFalloff | ( | ILBLightHandle | light, |
float | cutoff, | ||
float | exponent | ||
) |
Sets the falloff to type "Max Range" for a light source.
Not valid for directional lights, sky lights and ambient lights. By default falloff is disabled. By default clamping is enabled.
light | the light source to set falloff for |
cutoff | sets where the light intensity reaches zero. |
exponent | sets the exponent for the falloff |
ILBStatus ILBSetLightPolynomialFalloff | ( | ILBLightHandle | light, |
float | cutoff, | ||
float | constant, | ||
float | linear, | ||
float | quadratic, | ||
ILBBool | clampToOne | ||
) |
Sets the falloff to type "Polynomial" for a light source.
Not valid for directional lights, sky lights and ambient lights. By default falloff is disabled. By default clamping is enabled.
light | the light source to set falloff for |
cutoff | sets the influence range for the light source. |
constant | |
linear | |
quadratic | |
clampToOne | sets whether to clamp the falloff to be lower or equal to one. If set to false, the falloff is allowed to scale the intensity of the light up as well as down. |
ILBStatus ILBSetLightProjectedTexture | ( | ILBLightHandle | light, |
ILBTextureHandle | texture | ||
) |
Sets a projected texture for a light source (gobo).
Only works for spot lights.
light | light to add gobo on |
texture | texture to use as gobo |
ILBStatus ILBSetLightRampEntry | ( | ILBLightHandle | light, |
float | position, | ||
const ILBLinearRGB * | value | ||
) |
Adds a light ramp entry for falloff calculation.
The ramp extends from 0 to 1 in light space, use the transformation matrix to control the scale.
Works on point and spot lights.
light | light source to manipulate |
position | position in the ramp. Must be greater than 0 and greater than the last position. |
value | color of the given position in the ramp. |
ILBStatus ILBSetLightStats | ( | ILBLightHandle | light, |
ILBLightStatsMask | stats, | ||
ILBLightStatOperation | operation | ||
) |
Sets light status bits for a light source.
light | the light source to set light stats for |
stats | the stats to modify. Can be multiple light stats or:ed together |
operation | selects whether to enable or disable the selected light stats. |
ILBStatus ILBSetLightTransform | ( | ILBLightHandle | light, |
const ILBMatrix4x4 * | transform | ||
) |
Sets the transform for a light source.
light | the light source to change |
transform | the new transform |
ILBStatus ILBSetLightVolumeType | ( | ILBLightHandle | light, |
ILBLightVolumeType | type | ||
) |
Sets light volume type for a light source.
Only works for ambient lights and sky lights.
light | light to set light volume type on |
type | the volume type to use |
ILBStatus ILBSetShadowAngle | ( | ILBLightHandle | light, |
float | angleRadians | ||
) |
Sets the angle covered of the sky for a directional light or window light for shadow casting purposes.
The angle is 0 by default
light | the light source to set the radius on. |
angleRadians | the angle in radians. |
ILBStatus ILBSetShadowRadius | ( | ILBLightHandle | light, |
float | radius | ||
) |
Sets a radius for the light source as a shadow caster.
Only valid for point and spot lights. The radius is 0 by default.
light | the light source to set the radius on. |
radius | the radius. |
ILBStatus ILBSetShadowSamples | ( | ILBLightHandle | light, |
int32 | samples | ||
) |
Sets the maximum number of shadow samples for the light source.
Set to 1 by default
light | the light source to set the radius on. |
samples | the number of samples. |
ILBStatus ILBSetSkyLightTexture | ( | ILBLightHandle | light, |
ILBTextureHandle | texture | ||
) |
Sets a texture for a sky light.
The texture should be in Lat/Long format.
Only works for sky lights
light | light to set texture on |
texture | texture to use |
ILBStatus ILBSetSkyLightTextureFilter | ( | ILBLightHandle | light, |
float | filter | ||
) |
Sets texture filter size for a sky light.
Only works for sky lights
light | light to set filter size on |
filter | the filter size to use |
ILBStatus ILBSetSkyLightVolumeType | ( | ILBLightHandle | light, |
ILBLightVolumeType | type | ||
) |
Sets light volume type for a sky light.
Only works for sky lights
light | light to set light volume type on |
type | the volume type to use |
ILBStatus ILBSetSpotlightCone | ( | ILBLightHandle | light, |
float | angleRadians, | ||
float | penumbraAngleRadians, | ||
float | penumbraExponent | ||
) |
Sets the cone angle for a spotlight.
The cone is given in radians for the entire cone (as opposed to the angle towards the forward direction). The penumbra angle is the angle from the edge of the cone over which the intensity falls off to zero. The effective spread of the cone is max( angleRadians, angleRadians + 2*penumbraAngleRadians ) since the penumbra angle can be both positive and negative. The default cone angle is PI / 2 (90 degrees), The default is penumbra angle 0 The default penumbra exponent is 1
light | the light source to set cone angle for |
angleRadians | the angle in radians for the cone |
penumbraAngleRadians | the angle of the penumbra of the spot light. It's given as the difference from the cone angle and can be both negative and positive. |
penumbraExponent | the exponent for the gradient in the penumbra |