I'm learning from a sample in DirectX SDK on shadow map. This sample created a stencil surface during initialization, and says:
Create the depth-stencil buffer to be used with the shadow map
We do this to ensure that the depth-stencil buffer is large
enough and has correct multisample type/quality when rendering
the shadow map. The default depth-stencil buffer created during
device creation will not be large enough if the user resizes the
window to a very small size. Furthermore, if the device is created
with multisampling, the default depth-stencil buffer will not
work with the shadow map texture because texture render targets
do not support multisample.
What does this mean? I tried to comment the statements which creates and operates on the stencil buffer, then I got quite instable results: if I make the window greater, the shadow works well, while the shadow stops to move when I make the window much smaller. Does anyone can explain this to me? Thank you very much!!!