Renderer · const

MAX_ENV_PROBES

How many layers a grid may hold, and it is a memory limit rather than a binding one.

Explained in Hello world.

const MAX_ENV_PROBES = 64
import { MAX_ENV_PROBES } from '@driftengine/core';

In depth

Every probe is one layer of one array, so probes cost no texture units at all — the same thing the octahedral change bought the point lights, arrived at the same way. What they do cost is storage: a layer at the default size is 683 KB with its chain, so 64 layers is 43.7 MB, comfortably under the 92.3 MB pointShadowArray.ts already spends.

WebGL2 guarantees MAX_ARRAY_TEXTURE_LAYERS of 256, which would be 175 MB and is the number this is not set to. Raising it is an arithmetic decision about memory and the arithmetic is written here so nobody has to re-derive it.