CS 5610/6610 - Spring 2021 - Interactive Computer Graphics

Project 7 - Shadow Mapping

In this project we will implement shadow mapping.


Shadows on a teapot and a plane from a spot light.

Additional Requirements for CS 6610 Students



There are numerous online tutorials on shadow mapping. Note that some of them are old and use old OpenGL functions. I would recommend the two tutorials below, though neither one uses hardware depth comparison:

It would be a good idea to render the depth map and display the depth map on a plane, just to make sure that the depth map is correctly rendered (i.e. the object is visible in the depth map). Note that depending on the perspective projection matrix, all values in the depth map can be very similar, so the object may not be perceivable even if it is on the depth texture. It would be a good idea to use a debugger like GDebugger to see the contents of the rendered depth texture.

Also note that the GLRenderDepth2D class would require sampler2DShadow, when it is initialized as a depth comparison texture. If you would like to display the contents of this texture (for debuging purposes), do not initialize it as a depth comparison texture, so that you can use sampler2D instead.