Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist shadow atlas allocations between frames #1296

Open
tomas7770 opened this issue Jul 27, 2024 · 0 comments
Open

Persist shadow atlas allocations between frames #1296

tomas7770 opened this issue Jul 27, 2024 · 0 comments

Comments

@tomas7770
Copy link
Contributor

Problem

Currently, the shadow atlas plugin re-allocates space for every shadow map every frame. This is fine for small amounts of shadow casters, but can incur a performance cost as the amount grows.

Possible solution

Each shadow caster already stores an id value that is used to find its shadow map's location in the atlas. When the id is -1, it means that the shadow map hasn't been allocated yet. This can be used to detect new shadow casters being created between frames, and only allocate room for these.

Likewise, each possible location (Slot) for a shadow map contains the id of its corresponding caster. If no caster has this id, then the one that had it no longer exists.

@tomas7770 tomas7770 added A-Engine B-Rendering S-Triage Issues whose priority still has to be figured out C-Optimization labels Jul 27, 2024
@RiscadoA RiscadoA removed the S-Triage Issues whose priority still has to be figured out label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants