directionalLight2D
directionalLight2D(
lightDir,lightColor?,intensity?):Light2DResult
Defined in: packages/nodes/src/lighting/lights.ts:140
Calculate directional light (like sunlight) - infinite distance, uniform direction.
Parameters
Section titled “Parameters”lightDir
Section titled “lightDir”Direction the light is coming FROM (will be negated)
lightColor?
Section titled “lightColor?”Vec3Input = ...
Light color
intensity?
Section titled “intensity?”FloatInput = 1
Light intensity
Returns
Section titled “Returns”Light2DResult with no distance attenuation
Example
Section titled “Example”// Sun coming from top-rightconst sun = directionalLight2D([1, 1], [1, 0.95, 0.9], 1.0)