top of page

Shadow Mapping

Technologies: C++, OpenGL
One method of adding shadows to the scene is through use of shadow mapping. In order to do so, the scene is rendered onto a seperate frame buffer from the light source's point of view based on the depth that light rays can travel before it hits an object. This is stored in a depth map, in which an example is shown in the animation below. Afterwards, the fragment shader can check whether any parts of the scene is obstructed by an object indicated in the depth map. If this is the case, then that specific scene part should have a cast shadow.

The following animation below rapidly changes the color of the light, as if the person in the scene is in a party setting.

bottom of page