Renderer · function

areaShadowLayerCount

How many layers of the shared array a world's rectangles will take.

Explained in Hello world.

function areaShadowLayerCount(lights: readonly AreaLightSource[]): number
import { areaShadowLayerCount } from '@driftengine/core';

Parameters

ParameterTypeDescription
lightsreadonly AreaLightSource[]

In depth

Two per rectangle that declares it casts and names a range, and none for one that does not. A rectangle past MAX_AREA_LIGHTS is not shaded, so it gets no layer either — a layer for a light the loop never reaches is storage nothing can read.