from panda3d._rplight import ShadowAtlas

class ShadowAtlas

This class manages the shadow atlas. It handles finding and reserving space for new shadow maps.

Inheritance diagram

__init__(param0: ShadowAtlas) → None
__init__(size: size_t, tile_size: size_t) → None

This constructs a new shadow atlas with the given size and tile size.

The size determines the total size of the atlas in pixels. It should be a power-of-two to favour the GPU.

The tile_size determines the smallest unit of tiles the atlas can store. If, for example, a tile_size of 32 is used, then every entry stored must have a resolution of 32 or greater, and the resolution must be a multiple of 32. This is to optimize the search in the atlas, so the atlas does not have to check every pixel, and instead can just check whole tiles.

If you want to disable the use of tiles, set the tile_size to 1, which will make the shadow atlas use pixels instead of tiles.

getNumUsedTiles() → int

Returns the amount of used tiles in the atlas

getCoverage() → float

This returns in percentage from 0 to 1 how much space of the atlas is used right now. A value of 1 means the atlas is completely full, whereas a value of 0 means the atlas is completely free.

property num_used_tiles

Returns the amount of used tiles in the atlas

Return type

int

property coverage

This returns in percentage from 0 to 1 how much space of the atlas is used right now. A value of 1 means the atlas is completely full, whereas a value of 0 means the atlas is completely free.

Return type

float