Shadow
gfx.shadow.set_directional_atlas_size
ClientSets the size and depth precision of the directional shadow atlas
Syntax
local status = gfx.shadow.set_directional_atlas_size(
size,
is_16bits = nil
)A larger atlas gives sharper directional shadows at a memory cost.
- Shared — used by every directional light with shadows, and split between each light's cascades.
- Cost — memory and GPU cost grow with the square of the size, so
8192uses four times as much as4096. - Default —
4096with a 16-bit depth buffer.
Parameters
| Type | Name | Description |
|---|---|---|
int | size | Atlas size in pixels Must be between 256 and 16384, values that are not a power of two are rounded up to the next oneAn error is raised if the value is out of range |
bool | is_16bits | Determines the depth precision of the atlas: • When true - uses a 16-bit depth buffer, lower memory usage and faster• When false - uses a 32-bit depth buffer, higher precision at double the memory cost• When omitted - keeps the current setting |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
gfx.shadow.set_directional_atlas_size(8192)gfx.shadow.set_directional_atlas_size(4096, false)gfx.shadow.set_directional_atlas_size(gfx.shadow.get_directional_atlas_size(), true)