Blender Git Loki

Git Commits -> Revision 0142264

Revision 0142264 by Clément Foucault (master)
January 11, 2018, 15:50 (GMT)
Eevee: Lamps: Optimize lamps CPU/Memory usage.

Tests on my system with ~1200 objects with 128 shadow casting lamps (current max) show a significant perf improvment (cache timing : 22ms -> 9ms)
With a baseline with no shadow casting light at 6ms this give a reduction of the overhead from 16ms to 3ms.

This remove pretty much all allocations during the cache phase. Leading to a big improvement for scene with a large number of lights & shadowcasters.
The lamps storage has been replace by a union to remove the need to free/allocate everyframe (also reducing memory fragmentation).

We replaced the linked list system used to track shadow casters by a huge bitflag.
We gather the lights shadows bounds as well as the shadow casters AABB during the cache populate phase and put them in big arrays cache friendly.

Then in the cache finish phase, it's easier to iterate over the lamps shadow SphereBounds and test for intersection.

We use a double buffer system for the shadow casters arrays to detect deleted shadow casters.
Unfortunatly, it seems that deleting an object trigger an update for all other objects (thus tagging most shadow casting lamps to update), defeating the purpose of this tracking.
This needs further investigation.

Commit Details:

Full Hash: 0142264508925ddc02a67d5f65759ca24bafa387
Parent Commit: a08f687
Lines Changed: +286, -164

4 Modified Paths:

/source/blender/draw/engines/eevee/eevee_data.c (+7, -10) (Diff)
/source/blender/draw/engines/eevee/eevee_engine.c (+1, -6) (Diff)
/source/blender/draw/engines/eevee/eevee_lights.c (+211, -145) (Diff)
/source/blender/draw/engines/eevee/eevee_private.h (+67, -3) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021