DirectionalLight constructor

DirectionalLight({
  1. Vector3? direction,
  2. Vector3? color,
  3. double intensity = 3.0,
  4. int priority = 0,
  5. bool castsShadow = false,
  6. bool cacheStaticShadows = true,
  7. double shadowFadeRange = 2.0,
  8. double shadowSoftness = 0.08,
  9. int shadowCascadeCount = 4,
  10. double shadowMaxDistance = 150.0,
  11. double shadowCascadeSplitLambda = 0.6,
  12. int shadowMapResolution = 1024,
  13. double shadowDepthBias = 0.02,
  14. double shadowNormalBias = 0.02,
  15. double shadowAmbientStrength = 0.0,
  16. DirectionalShadowFilter shadowFilter = DirectionalShadowFilter.rotatedPoisson,
  17. ShadowCasterFaces shadowCasterFaces = ShadowCasterFaces.front,
  18. bool contactShadows = false,
  19. double contactShadowDistance = 0.3,
  20. double angularRadius = 0.005,
})

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.priority = 0,
  this.castsShadow = false,
  this.cacheStaticShadows = true,
  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,
  this.shadowAmbientStrength = 0.0,
  this.shadowFilter = DirectionalShadowFilter.rotatedPoisson,
  this.shadowCasterFaces = ShadowCasterFaces.front,
  this.contactShadows = false,
  this.contactShadowDistance = 0.3,
  this.angularRadius = 0.005,
}) : direction = direction ?? defaultDirection,
     color = color ?? Vector3(1.0, 1.0, 1.0);