Friday, 12 April 2013

Shadow Mapping

Shadow Mapping, otherwise known as projective shadowing, is a process of 3D computer graphic by which shadows are added into the scene. Shadows are created by testing whether a pixel is visible from the light source, you do this by comparing the z-buffer or depth image of the source's view, and it is then stored in a texture.

 Basically Shadow Mapping works by that it checks if a point is visible from the light or not. If a point is visible from the light then it's obviously not a shadow. The shadow mapping algorithm can describe as such:
  • Render the scene from the lights view point and then store the shadows (more specifically its depths)
  • Then render the scene from the camera and compare shadows (again more specifically the depths), whatever depth is greater is the shadow
  
The hard part of Shadow Mapping is the actual implementation since it is hard to select the appropriate bias and hard to get rid if artifacts at shadows edges. The basic principle of Shadow Mapping is that when you look out from a light source, all the objects you can see in a scene would appear in light, however anything behind those objects would be in shadow.
 Shadowing Mapping is a helpful technique used in video games, because it helps create realistic shadows, which act the way shadows do in real life. Nothing is worse than having shadows that are not displaying in the correct way, it breaks the illusion and makes the scene look fake. When shadows are implemented incorrectly in games it completely ruins the game's aesthetic appeal.

No comments:

Post a Comment