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
| |
| float | AttenuationLinear [get, set] |
The linear value in the Lighting formula
| |
| float | AttenuationQuadratic [get, set] |
The quadratic value in the Lighting formula
| |
| 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.
| |
| 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. | |
| void ERY.AgateLib.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.
| constant | ||
| linear | ||
| quadratic |
float ERY.AgateLib.Light.AttenuationConstant [get, set] |
float ERY.AgateLib.Light.AttenuationLinear [get, set] |
float ERY.AgateLib.Light.AttenuationQuadratic [get, set] |
float ERY.AgateLib.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.
bool ERY.AgateLib.Light.Enabled [get, set] |
Gets or sets whether or not this Light should have any effect on anything which is rendered.
Color ERY.AgateLib.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.
Color ERY.AgateLib.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.
Color ERY.AgateLib.Light.Specular [get, set] |
Specular highlight color, or "shininess." Not currently used.
Vector3 ERY.AgateLib.Light.Position [get, set] |
|
AgateLib Awesome Game and Tool Engine Library |
|