DirectionalLight#
Directional light shining along its object's local -Z (like the camera looks). Color is sRGB hex; intensity scales direct light; ambient is a uniform fill in the same linear units.
public sealed record DirectionalLight(string Color = "#FFFFFF", float Intensity = 2f, float Ambient = .25f, bool CastShadows = true, float ShadowDistance = 40, float ShadowSoftness = 1.5f, float ContactShadows = .3f)Record properties#
| Property | Type | Access | Constructor default |
|---|---|---|---|
Color | string | get; init; | "#FFFFFF" |
Intensity | float | get; init; | 2f |
Ambient | float | get; init; | .25f |
CastShadows | bool | get; init; | true |
ShadowDistance | float | get; init; | 40 |
ShadowSoftness | float | get; init; | 1.5f |
ContactShadows | float | get; init; | .3f |
ContactShadows: Metres of screen-space shadow where things touch (a crate on the floor, a hand on a desk): the reflected depth is marched toward the sun this far. 0 turns it off.
Source#
- Model3D.cs