Lecture #8: Shadows
Computer graphics in Game development
Ivan Belyavtsev
25.01.2020
Shadow mapping
There are two passes:
- Shadow map generation
- 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
- Black image
- Color space
- Bresenham’s line algorithm
- Read OBJ file
- Projections
- Triangle rasterization
- Z-buffer culling
- Phong model
- Texturing
- Shadow mapping