I'm currently trying to extend my current basic shadow mapping system to allow objects to have shadows cast from multiple lights. At the moment I have generated both shadow maps correctly but the problem is getting them both to be rendered on the scene.
My draw function currently goes like this:
for (int iLight = 0; iLight < mNumLights; iLight++)
{
mShadowMap[iLight]->SetNullRenderTarget(md3dImmediateContext);
DrawSceneToShadowMap(iLight);
RestoreRenderTarget();
SetShadowMap(iLight);
SetShadowTransform(iLight);
DrawScene();
}
mSwapChain->Present(0, 0)
Only the second shadow map is used and drawn, what am I missing here?