resolve method
Updates light from the current sun and returns it. Called by the engine once per frame before the scene is shaded; not part of the app-facing API.
Implementation
DirectionalLight resolve() {
// The sun direction points toward the sun; the light travels the other way.
light.direction
..setFrom(source.sunDirection)
..negate();
light.color.setFrom(color ?? source.sunLightColor);
light.intensity = (intensity ?? source.sunLightIntensity) * intensityScale;
light.castsShadow = castsShadow;
light.shadowSoftness = shadowSoftness;
light.shadowMaxDistance = shadowMaxDistance;
light.shadowCascadeCount = shadowCascadeCount;
light.shadowMapResolution = shadowMapResolution;
light.shadowDepthBias = shadowDepthBias;
light.shadowNormalBias = shadowNormalBias;
light.shadowFadeRange = shadowFadeRange;
light.shadowCascadeSplitLambda = shadowCascadeSplitLambda;
light.shadowAmbientStrength = shadowAmbientStrength;
light.shadowCasterFaces = shadowCasterFaces;
return light;
}