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. double? firstCascadeFarBound,
  13. double cascadeOverlap = 0.0,
  14. int shadowMapResolution = 1024,
  15. double shadowDepthBias = 0.02,
  16. double shadowNormalBias = 0.02,
  17. double shadowAmbientStrength = 0.0,
  18. DirectionalShadowFilter shadowFilter = DirectionalShadowFilter.rotatedPoisson,
  19. ShadowCasterFaces shadowCasterFaces = ShadowCasterFaces.front,
  20. bool contactShadows = false,
  21. double contactShadowDistance = 0.3,
  22. double angularRadius = 0.005,
  23. int channelMask = 0xFF,
  24. int shadowCasterChannelMask = 0xFF,
})

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.firstCascadeFarBound,
  this.cascadeOverlap = 0.0,
  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,
  this.channelMask = 0xFF,
  this.shadowCasterChannelMask = 0xFF,
}) : direction = direction ?? defaultDirection,
     color = color ?? Vector3(1.0, 1.0, 1.0);