AgateLib.DisplayLib.Light Class Reference

Class which represents a single light source. Only point light sources are supported at the moment. More...

List of all members.

Public Member Functions

void SetAttenuationModel (float constant, float linear, float quadratic)
 Sets the three constants in the attenuation model. See remarks for details.

Properties

float AttenuationConstant [get, set]
 The constant value in the Lighting formula
See also:
SetAttenuationModel

.
float AttenuationLinear [get, set]
 The linear value in the Lighting formula
See also:
SetAttenuationModel

.
float AttenuationQuadratic [get, set]
 The quadratic value in the Lighting formula
See also:
SetAttenuationModel

.
float Range [get, set]
 Gets or sets the distance at which the rendering API can consider the light too far away to have any affect.
bool Enabled [get, set]
 Gets or sets whether or not this Light should have any effect on anything which is rendered.
Color Ambient [get, set]
 Ambient color for the light. Ambient color is not affected by the dot product with the normal, so it appears to attenuate slower.
See also:
Diffuse

.
Color Diffuse [get, set]
 Diffuse color for the light. The diffuse color is modulated by the dot product of the direction to the light with the surface normal (for 2D drawing in AgateLib, surface normals are always in the negative z direction). So it attenuates faster than the Ambient color does.
Color Specular [get, set]
 Specular highlight color, or "shininess." Not currently used.
Vector3 Position [get, set]
 The position of the Light source, in 3D space. Normals in AgateLib are in the negative z direction, so it is recommended to make Position.Z a negative number. How negative depends on the Attenuation model and what kind of effect you wish to create with the lighting.


Detailed Description

Class which represents a single light source. Only point light sources are supported at the moment.


Member Function Documentation

void AgateLib.DisplayLib.Light.SetAttenuationModel ( float  constant,
float  linear,
float  quadratic 
)

Sets the three constants in the attenuation model. See remarks for details.

Lights decrease in intensity for objects which are farther away from the lights. This is called attenuation. Point Lights are attenuated according to the following formula:

K = C0 + C1*d + C2*d2

A = 1 / K

where d is the distance from the light the object being rendered is. The Light's color components are multiplied by A to decrease the intensity of the light on this object.

Parameters:
constant 
linear 
quadratic 


Property Documentation

Color AgateLib.DisplayLib.Light.Ambient [get, set]

Ambient color for the light. Ambient color is not affected by the dot product with the normal, so it appears to attenuate slower.

See also:
Diffuse

.

float AgateLib.DisplayLib.Light.AttenuationConstant [get, set]

The constant value in the Lighting formula

See also:
SetAttenuationModel

.

float AgateLib.DisplayLib.Light.AttenuationLinear [get, set]

The linear value in the Lighting formula

See also:
SetAttenuationModel

.

float AgateLib.DisplayLib.Light.AttenuationQuadratic [get, set]

The quadratic value in the Lighting formula

See also:
SetAttenuationModel

.

Color AgateLib.DisplayLib.Light.Diffuse [get, set]

Diffuse color for the light. The diffuse color is modulated by the dot product of the direction to the light with the surface normal (for 2D drawing in AgateLib, surface normals are always in the negative z direction). So it attenuates faster than the Ambient color does.

bool AgateLib.DisplayLib.Light.Enabled [get, set]

Gets or sets whether or not this Light should have any effect on anything which is rendered.

Vector3 AgateLib.DisplayLib.Light.Position [get, set]

The position of the Light source, in 3D space. Normals in AgateLib are in the negative z direction, so it is recommended to make Position.Z a negative number. How negative depends on the Attenuation model and what kind of effect you wish to create with the lighting.

float AgateLib.DisplayLib.Light.Range [get, set]

Gets or sets the distance at which the rendering API can consider the light too far away to have any affect.

Color AgateLib.DisplayLib.Light.Specular [get, set]

Specular highlight color, or "shininess." Not currently used.


The documentation for this class was generated from the following file:
AgateLib
Awesome Game and Tool Engine Library
SourceForge.net Logo