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

Started by
0 comments, last by slicer4ever 8 years, 8 months ago

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.)

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.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

This topic is closed to new replies.

Advertisement