Click or drag to resize
DigitalRuneGraphicsHelperGetAngularAttenuation Method
Computes the angular attenuation (spotlight falloff) for a given angle.

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public static float GetAngularAttenuation(
	float angle,
	float falloffAngle,
	float cutoffAngle
)

Parameters

angle
Type: SystemSingle
The angle relative to the main light direction in radians.
falloffAngle
Type: SystemSingle
The falloff angle.
cutoffAngle
Type: SystemSingle
The cutoff angle.

Return Value

Type: Single
The angular attenuation of the light intensity. (1 when angle is less than or equal to falloffAngle. 0 when angle is greater than or equal to cutoffAngle.)
Remarks

The falloff between falloffAngle and cutoffAngle is computed using a smoothstep function (see HermiteSmoothStep(Single)).

angularAttenuation = smoothstep((cos(angle) - cos(cutoffAngle)) / (cos(falloffAngle) - cos(cutoffAngle)))

See Also