   About ShadowMap, how to process vertices that outside light's view frustum?
  About DX's ShadowMap sample, how to process vertices that outside light's view frustum but inside the camera's view frustum?In Dx's ShadowMap sample, they first render the scene in light's point of view;then render the scene in camera's point of view; In most cases, we can't render the whole scene, because the scene is very large.We consider that, in world space, the light's view frustum and the camera's view frustum are not complete coincidence, they are intersection partly.When we render the scene in camera's point of view, for those vertices that inside camera's view frustum but outside light's view frustum. they must also be converted to light's point of view space for shadow map lookup and compare.Because those vertices are outside light's view frustum, are those vertices coordinate be out of range [-1, 1],[-1, 1],[0, 1] when they are converted to light's projection space?If so, when those vertices' coordinate were converted to texture's uv coordinate, they also must be out of range [0, 1],[0, 1] of uv coordinate?If so, when we use tex2D to sample texel from shadow map, error must occur because uv coord out of range.DX's sample how to process this? thanks! I can speak english a little, please don't mind......   
Quote:Original post by Game_XinBingIf so, when we use tex2D to sample texel from shadow map, error must occur because uv coord out of range.You don't get an error if your texture coordinates are outside of the [0,1] range. Instead the behavior is defined by your sampler states, in particular D3DSAMP_ADDRESSU, D3DSAMP_ADDRESSV, D3DSAMP_BORDERCOLOR. For shadow mapping it's often convenient to set the U and V address states to D3DTADDRESS_BORDER, and then set the border color to 0xFFFFFFFF. This will make it so that any pixels outside of the shadow caster's view frustum won't be shadowed;  If you're talking about something like shadowmaps for sunlight, this situation shouldn't really happen. The light frustum should be suitably sized so that it covers everything that could potentially set a pixel in the camera's view to shadowed. This involves setting the near/far planes of the light frustum to include any objects that are not necessarily in the camera's frustum but are in line with the lightsource and the area viewed by the camera, eg, planes, birds, etc.By camera I mean the scene viewing position.Think I misread the original post, in which case... What Matt said :)   ;  Thank you all very much...