Skip to content
  • Guus Sliepen's avatar
    Add shadow mapping tutorial. · a13bd0d9
    Guus Sliepen authored
    This tutorial implements very basic shadow mapping: the scene is rendered as
    seen from the light source, the depth buffer of the result is stored in a
    texture. Then the scene is rendered as seen from the camera, and in the vertex
    shader we calculate both the light and camera projection of the vertex. In the
    fragment shader, we can look up the depth value from the shadow map texture,
    and if it is lower (ie, closer to the light source) than the current fragment
    is as seen from the light source, it must be in shadow.
    
    Several parameters can be changed while running the program, to show trade-offs
    between the light source FOV, shadow map size and whether to cull front or back
    faces during the calculation of the shadow map.
    a13bd0d9