| GraphicsHelperGetAngularAttenuation Method |
Computes the angular attenuation (spotlight falloff) for a given angle.
Namespace: DigitalRune.GraphicsAssembly: 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
)
Public Shared Function GetAngularAttenuation (
angle As Single,
falloffAngle As Single,
cutoffAngle As Single
) As Single
public:
static float GetAngularAttenuation(
float angle,
float falloffAngle,
float cutoffAngle
)
static member GetAngularAttenuation :
angle : float32 *
falloffAngle : float32 *
cutoffAngle : float32 -> float32
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