| EphemerisGetSunlight Method |
Computes the sunlight intensity.
Namespace: DigitalRune.GraphicsAssembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax public static void GetSunlight(
float altitude,
float turbidity,
Vector3D sunDirection,
out Vector3F directSunlight,
out Vector3F scatteredSunlight
)
Public Shared Sub GetSunlight (
altitude As Single,
turbidity As Single,
sunDirection As Vector3D,
<OutAttribute> ByRef directSunlight As Vector3F,
<OutAttribute> ByRef scatteredSunlight As Vector3F
)
public:
static void GetSunlight(
float altitude,
float turbidity,
Vector3D sunDirection,
[OutAttribute] Vector3F% directSunlight,
[OutAttribute] Vector3F% scatteredSunlight
)
static member GetSunlight :
altitude : float32 *
turbidity : float32 *
sunDirection : Vector3D *
directSunlight : Vector3F byref *
scatteredSunlight : Vector3F byref -> unit
Parameters
- altitude
- Type: SystemSingle
The altitude (elevation) of the observer's position in meters above the mean sea level.
- turbidity
- Type: SystemSingle
The turbidity, which measures how polluted the air is. The values should be in the range
[1.8, 20]. A turbidity of 2 describes a clear day whereas a turbidity of 20 represents thick
haze. A commonly used value is 2.2.
- sunDirection
- Type: DigitalRune.Mathematics.AlgebraVector3D
The direction from the observer's position to the sun. - directSunlight
- Type: DigitalRune.Mathematics.AlgebraVector3F
The direct sunlight illuminance in [lux]. - scatteredSunlight
- Type: DigitalRune.Mathematics.AlgebraVector3F
The scattered sunlight illuminance (= ambient light, indirect light or "skylight"
contribution of the sun) in [lux].
Remarks
The light values are computed for the earth using NASA data, experimental data and a
physically-based model of the atmosphere.
All light values are computed for a cloudless sky. When the sky is cloudy, reduce the direct
light and increase the scattered/ambient light. Additionally you will want to increase the
ambient light at night to model light pollution.
Thread-Safety: This method is not thread-safe, i.e. it
must not be called simultaneously from multiple threads.
See Also