title: Shadow mapping for many light sources - is it slow?
body: <p>I've reached a point where I've implemented deferred rendering and shadow mapping for a single light source. I was looking forward to adding more light sources to see how deferred rendering improves the performance but I realized that shadow mapping pretty much ruins it this time. </p>
  
  <p>Is this to be expected? Should I use another shadow algorithm when having many light sources? </p>
  
  <p>What I do is create a cube map from every light's point of view. Then, when rendering a fragment in the deferred rendering shader I take into account how much each light contributes to that fragment, meaning which lights the fragment  can see. So, it's just a normal check of whether a fragment is in the shadows of a light source. </p>