Original Post
I have deferred renderer in DX11 so I can support many lights. I have the option to make each light cast shadows with shadow maps. I am looking for good ideas on a system to determine when a shadow map needs to be updated. Examples that could cause a shadow map update:
1. Light moves
2. An object in the scene moves
3. An object is animated
4. An object is removed/added to the scene
My current idea is for each light to keep track of an object visibility list. If one of the above events occurs, then each light updates its visibility list and checks if it changed. If it changed, then it updates its shadow map using its updated visiblity list. If a light contains an animated object, then it always updates its shadow map. Obviously, a good data structure to query visibility is needed.
Another idea I had was to process one light per frame. So one light would check if its visibility list has changed, and update the shadow map if it had. Assuming I have less that 90 lights and am getting over 30 FPS, all shadow maps would be updated within 3 seconds (if I had to update all at once, which really should be never except at level load time). Although, I doubt it would happen, this also prevents a stall if I had to update all my shadow maps at once for some reason, as it spreads the work across frames.
Anyway, I'm just checking to see if anyone had good ideas / data structures for this.
1. Light moves
2. An object in the scene moves
3. An object is animated
4. An object is removed/added to the scene
My current idea is for each light to keep track of an object visibility list. If one of the above events occurs, then each light updates its visibility list and checks if it changed. If it changed, then it updates its shadow map using its updated visiblity list. If a light contains an animated object, then it always updates its shadow map. Obviously, a good data structure to query visibility is needed.
Another idea I had was to process one light per frame. So one light would check if its visibility list has changed, and update the shadow map if it had. Assuming I have less that 90 lights and am getting over 30 FPS, all shadow maps would be updated within 3 seconds (if I had to update all at once, which really should be never except at level load time). Although, I doubt it would happen, this also prevents a stall if I had to update all my shadow maps at once for some reason, as it spreads the work across frames.
Anyway, I'm just checking to see if anyone had good ideas / data structures for this.