Advanced Shadows Techniques in Game Development

shadows n.w
1 / 12
Embed
Share

Discover the intricacies of shadows in game graphics, from shadow volumes to shadow maps, shadow rays, and shadow bias. Learn about common algorithms and resolutions used, as well as techniques to combat shadow acne and aliasing.

  • Game Development
  • Graphics
  • Shadows
  • Techniques
  • Algorithms

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Shadows UMBC Graphics for Games

  2. Punctual Shadow Algorithms

  3. Shadow Volumes Seldom used now Find silhouette faces (extend triangle including light & edge) Increment counter for front-facing Hardware has a stencil buffer that is perfect for this Decrement counter for back-facing Lit if not 0 Problems & Variations Eye inside volume Adapt starting count, or count from Lots of pixels to fill Clipping & culling helps, but this is shadow volume s biggest problem -1 +1 +1

  4. Shadow Rays Trace rays through some representation of the geometry Ray tracing s primary shadow method Distance Field Shadows Pre-process 3D grid of distances to closest object Ray march (like volume shadows) At each step, can go at least as far as the distance stored there before you hit anything

  5. Shadow Map Most common method Render objects from camera at light Each pixel has 3D position, from shadow map pixel position from stored depth value Render objects (or deferred pass) Each pixel has 3D position, from pixel position, Transform of the first thing the light sees from pixel depth to light space, compare to

  6. Shadow Acne & Shadow Bias Numerical error for closest surface = self shadowing sometimes says yes when Appears as random spots of shadow Bias Rather than , use Too little, still get artifacts Too much, and objects seem to float Some methods adjust per pixel should equal

  7. Shadow Resolution Want about 1 shadow pixel per pixel Warped shadow space Non-linear shadow map pixel spacing Works for lights perpendicular to view, but not head lights Cascaded shadow maps Multiple shadow maps at different resolutions for each depth range This is the choice for most games UE4 shadow atlas

  8. Shadow Aliasing Blending depths doesn t work Blending near & far depths gives a hard aliased shadow at a depth between them Percentage Closer Filtering (PCF) Evaluate shadow (0) or not (1) at four shadow texels Blend these intensities Variance Shadow Maps (VSM), [Moment Shadow Maps (MSM)] Average Z, Z2, [Z3, Z4] Estimate variance and shadow coverage Prone to precision problems & light leaks (assumes Gaussian-distributed depths) Exponential (& others): like VSM, but different distribution assumptions

  9. Soft Shadows Area lights give soft-edged shadows Umbra (full shadow) Penumbra (partial shadow) Contact hardening Penumbra size depends on how close blocker is to surface Umbra Penumbra

  10. Abuse Shadow Filtering For any of PCF, VSM, MSM Lie about the filter size Usually a fixed amount of softening

  11. Percentage Closer Soft Shadows (PCSS) Realistic penumbra width and contact hardening Assumes a spherical light Sample shadow map to estimate blocker distance Turn to per-pixel filter radius for PCF, VSM, MSM, etc. Similar triangles:

  12. Multiple Point Lights Same lights for all pixels = shadow bands Different lights for each pixel = noisy shadows Recent work combines LTC & per-pixel sampling Basically factors in how much shadows change things

Related


More Related Content