Scale viewprojsaved world object vthe matrices can concatenated the cpu
NVIDIA GPU Programming Guide
�Perspective Shadow Maps: Care and Feeding in GPU Gems: Programming Techniques, T
()3)Use GetSurfaceLevel(0) to get the IDirectDrawSurface9 Interface
4)Set the Surface pointer as the Z buffer in SetDepthStencilSurface()
9)Bind the shadow map texture to a sampler, and set the texture coordinates to be:
V’ = Bias(0.5/TexWidth, 0.5/TexHeight, 0) *
10)If using the fixed-function pipeline or ps_1.0-1.3, set the projection flags to be D3DTTFF_COUNT4 | D3DTTFF_PROJECTED.
11)If using pixel shaders 1.4 or higher, perform a projected texture fetch from the shadow map sampler.
14)If you turn on D3DFILTER_LINEAR for the shadow map sampler, the hardware will perform 4 depth comparisons, and bilinearly filter the results for the same cost as one sample—this just makes things look better.
15)Use this value to modulate with your lighting
54