I am new to Shadows in D3D9/10/11
I have been following this tutorial which is quite clear:
https://takinginitiative.wordpress.com/2011/05/15/directx10-tutorial-10-shadow-mapping/
Let's say you have drawn the scene with couple hundred of draw calls and you are about to render the shadows. The vertex shader is defined as:
struct PS_INPUT
{
float4 pos : SV_POSITION;
float4 lpos : TEXCOORD0; //vertex with regard to light view
float3 normal : NORMAL;
};
//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
PS_INPUT VS( VS_INPUT input )
{
PS_INPUT output;
output.pos = mul( input.pos, mul( world, viewProj ) );
output.normal = input.normal;
//store worldspace projected to light clip space with
//a texcoord semantic to be interpolated across the surface
output.lpos = mul( input.pos, mul( world, lightViewProj ) );
return output;
}
My question is, do you need to pass all Draw Calls again as a second pass, or there is a way to get the vertices previously drawn from the GPU or somehwere else? The former seems quite expensive in terms of performance.
Any clarification is highly appreciated.
Thanks !