Create the scene's directional light
sunDirection Vector2 optionalToward the sun, it shines the other way, as render3D.sunDirection
color Color optionalColor of the light; alpha modulates intensity
new DirectionalLight(vec2(-1, 1), hsl(.1, .3, 1)); // a warm sun up and to the left, shining down and to the right
World units the light gets into a background area from its edges facing it
World units a long shadow reaches before it has faded out; a caster casts only from
inside the shadow map, shadowMapScale views across, so past (shadowMapScale - 1) / 2 of a view beyond the
screen it throws none in
Toward the sun, it shines the other way, as render3D.sunDirection
Destroy the light, the scene goes without it from the next frame
immediate boolean optional
A directional light draws nothing of its own, it is added into the lightmap by the plugin
Check its settings, called automatically each frame