Shadow
gfx.shadow.set_positional_atlas_size
ClientSets the size and depth precision of the positional shadow atlas
Syntax
local status = gfx.shadow.set_positional_atlas_size(
size,
is_16bits = nil
)A larger atlas gives sharper omni and spot light shadows at a memory cost.
- Shared — used by every omni and spot light with shadows.
- Quadrants — split into four quadrants, see
gfx.shadow.set_positional_atlas_quadrant_subdiv. - 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_positional_atlas_size(8192)gfx.shadow.set_positional_atlas_size(2048, true)