Lecture #8: Shadows

Computer graphics in Game development

Ivan Belyavtsev

25.01.2020

Shadow mapping

There are two passes:

  1. Shadow map generation
  2. Apply shadow maps to final image [1]

Shadow map generation

  • Setup square render target (only depth buffer)
  • Place a camera to light source and look to opposite direction
  • Make an orthographical projection
  • Render all geometry [1]

Apply shadow maps to final image

  • Render final scene
  • Using model space vertex position compute shadow map coordinates
  • If \(Z\) from shadow map and computed \(Z\) are different - there is a shadow
  • Reduce color intensity in shadow pixels [1]

“Shadow mapping” experiment

Experiment

Let’s implement it together

“Shadow mapping” experiment

What is the new knowledge?

Individual assignments

Due date: Feb 21

  1. Black image
  2. Color space
  3. Bresenham’s line algorithm
  4. Read OBJ file
  5. Projections
  6. Triangle rasterization
  7. Z-buffer culling
  8. Phong model
  9. Texturing
  10. Shadow mapping

References

1. opengl-tutorial.org. Tutorial 16 : Shadow mapping [Electronic resource]. 2012. URL: http://www.opengl-tutorial.org/ru/intermediate-tutorials/tutorial-16-shadow-mapping/.