DirectionalLight constructor

DirectionalLight({
  1. Vector3? direction,
  2. Vector3? color,
  3. double intensity = 3.0,
  4. bool castsShadow = false,
  5. double shadowFadeRange = 2.0,
  6. double shadowSoftness = 0.08,
  7. int shadowCascadeCount = 4,
  8. double shadowMaxDistance = 150.0,
  9. double shadowCascadeSplitLambda = 0.6,
  10. int shadowMapResolution = 1024,
  11. double shadowDepthBias = 0.02,
  12. double shadowNormalBias = 0.02,
})

Creates a DirectionalLight.

direction is the direction the light travels in world space (from the light toward the scene). color is the light's linear RGB; intensity scales it.

Implementation

DirectionalLight({
  Vector3? direction,
  Vector3? color,
  this.intensity = 3.0,
  this.castsShadow = false,
  this.shadowFadeRange = 2.0,
  this.shadowSoftness = 0.08,
  this.shadowCascadeCount = 4,
  this.shadowMaxDistance = 150.0,
  this.shadowCascadeSplitLambda = 0.6,
  this.shadowMapResolution = 1024,
  this.shadowDepthBias = 0.02,
  this.shadowNormalBias = 0.02,
}) : direction = direction ?? Vector3(-0.3, -1.0, -0.2),
     color = color ?? Vector3(1.0, 1.0, 1.0);