fesoliveira014 / yanve

0 stars 0 forks source link

Cascaded Shadow Maps #9

Open fesoliveira014 opened 4 years ago

fesoliveira014 commented 4 years ago

Implement Cascaded Shadow Mapping technique for shadowing.

Resources:

fesoliveira014 commented 4 years ago

Algorithm:

  1. Partition the frustum into subfrusta.
  2. Compute an orthographic projection for each subfrustum.
  3. Render a shadow map for each subfrustum.
  4. Render the scene.
  5. Bind the shadow maps and render.
    • The vertex shader does the following:
      • Computes texture coordinates for each light subfrustum (unless the needed texture coordinate is calculated in the pixel shader).
      • Transforms and lights the vertex, and so on.
    • The pixel shader does the following:
      • Determines the proper shadow map.
      • Transforms the texture coordinates if necessary.
      • Samples the cascade.
      • Lights the pixel.