Let me describe my Idea of how I wanted my Scene/Renderer classes to work. Then maybe someone with more experience can guide me and steer me the right direction.
The Scene Manager could arrange them in a Oct(quad) tree. Scene Manager also holds all the light information.
My Renderer class gets a list of visible entities from the Scene Manger when it goes to render the scene. It also gets a list of Lights from each entity and lets say I limit the lights that can be sent to the shaders by 8. It sends the closest lights (and all directional lights) to the shaders.
So I was thinking that there would be a "dirty" flag gets set when an entity is moved. And then once a frame the scene manager checks all dirty flags of entities and re-caches lights information (scene manager re adds it to the octree).
I Guess if I cached light information they would need dirty flags as well, and moving a light means iterating all entities to update light information for that light.
Would it be better for the scene manager to return a query of lights when the redenderer asked for them based on the position of an object and this not cached? That way Scene manager doesn't have to keep checking dirty states etc..
Any thoughts or comments that someone can help me with?