Shadow

gfx.shadow.set_positional_atlas_quadrant_subdiv

Client

Sets the subdivision level of a positional shadow atlas quadrant

Syntax

local status = gfx.shadow.set_positional_atlas_quadrant_subdiv(
    quadrant,
    subdiv
)

Lights are placed in a quadrant that matches how large they appear on screen.

  • Close lights — land in quadrants with few subdivisions, which have the sharpest shadow maps.
  • Distant lights — land in quadrants with many subdivisions, where a small shadow map is enough.
  • Capacity — a quadrant holds only as many shadow maps as its subdivision allows, extra lights may lose shadows.
  • Default — quadrants 0 and 1 use X4, quadrant 2 uses X16 and quadrant 3 uses X64.

Parameters

TypeNameDescription
intquadrantQuadrant index to target
Must be between 0 and 3, an error is raised otherwise
gfx.shadow.subdivsubdivSubdivision level to apply

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Give the first quadrant fewer, sharper shadow maps
gfx.shadow.set_positional_atlas_quadrant_subdiv(0, gfx.shadow.subdiv.X1)
Disable the last quadrant
gfx.shadow.set_positional_atlas_quadrant_subdiv(3, gfx.shadow.subdiv.DISABLED)
Favor many lights over shadow resolution
gfx.shadow.set_positional_atlas_quadrant_subdiv(0, gfx.shadow.subdiv.X16)
gfx.shadow.set_positional_atlas_quadrant_subdiv(1, gfx.shadow.subdiv.X64)
gfx.shadow.set_positional_atlas_quadrant_subdiv(2, gfx.shadow.subdiv.X256)
gfx.shadow.set_positional_atlas_quadrant_subdiv(3, gfx.shadow.subdiv.X1024)

On this page