• Advertisement
Sign in to follow this  

How does each pixel in Shadow Map correspond to each pixel in scene?

This topic is 1000 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How each pixel is supposed to correspond from Shadow map to Scene. For example, I've a sphere and I know it's nearest pixels from shadow map at it's edges. But what if in the scene, this pixels do not correspond to sphere or somewhere outside sphere? Can anyone please explain me shadow mapping and projective texture precisely (like Projection vertex onto light's projection window, then from NDC space to view space and then using that texCoords to sample shadow map, etc.)

Share this post


Link to post
Share on other sites
Advertisement

you render the scene from your lights perspective, and save the depth buffer. you then take another render of your scene from your cameras perspective, but you also tell it the light's position as well, so when you translate your point by your camera matrix, you also translate it by your light's matrix as well. now you have 2 pixels, one for where it would be if seen by the light, and one for your camera. you then can compare if that pixel's light position depth is > then the pixel the light saw at that position. if it is, that means it's shadowed, if it isn't, that means it is visible to the light, and not shadowed.

Edited by slicer4ever

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement