This has probably been discussed before, so please forgive me as I’m searching through the forum, but I am generalizing my shadow map code and am wondering which of these approaches would be better.
Have a FBO for each shadow casting light, then when a shadow map needs updated just bind this fbo and go for it.
allocate depth textures for each shadow casting light, and a pool of color textures of the used sizes (for completeness), when a shadow map needs updated use 1 fbo for all, and link up the texture ids stored in the light.
The world is somewhat arbitrary, so I don’t know how many shadow casters there will be at one time, but probably only a couple that might need updating in a frame. (for obvious reasons)
Any thoughts are much appreciated.