1 / 16

GAM532 DPS932 – Week 7

GAM532 DPS932 – Week 7. Introduction to shadows. Shadow Effects. No Shadows. Shadows. Surface. Surface. Light. Light. Types of Shadow Techniques. Baked Lighting. Blob Shadows. Shadows Volumes. Depth Map Shadows. Performant. Immersive. Baked Lighting and Static Lights.

abeni
Télécharger la présentation

GAM532 DPS932 – Week 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GAM532DPS932 – Week 7 Introduction to shadows

  2. Shadow Effects No Shadows Shadows Surface Surface Light Light

  3. Types of Shadow Techniques Baked Lighting Blob Shadows Shadows Volumes Depth Map Shadows Performant Immersive

  4. Baked Lighting and Static Lights Can be very high detail Almost costless Computations happen during development Lights and actors cannot move Static lights are not part of the scene Cannot change at runtime

  5. Blob Shadows Light Dir:[ 0, -1, 0 ] Scene without shadow Static Shadow Texture Scene with blob applied to underlying geometry Shadows can move with the scene Low performance cost Shadows cannot change at runtime Low detail approximations Only works well with single simple light Light Dir:[ 0.7, -0.7, 0 ]

  6. Shadows Volumes Shadowed Scene Extrude Shadow Volume Render Scene Depth Render Volume Stencil

  7. Extruding Shadow Volumes Light Actor Shadowed Scene Shadow Volumes

  8. Rendering Depth and Stencil A Front Face: Fail (-1) Back Face: Fail (+1) Stencil = 0 B Front Face: Pass (0) Back Face: Fail (+1) Stencil = 1 C Front Face: Pass (0) Back Face: Pass (0) Stencil = 0 Render Depth Render Volume Stencil

  9. Final Result High Detail (model limited) Additive Blocks the light for each light pass Dynamically changing Shadow Self Shadowing CPU Intensive Modulative Darkens the geometry after lighting pass Modulative darkens scene with multiple lights Detail limited by mesh detail Very expensive with high polygon meshs

  10. Depth Texture Shadows Compare depth from light’s depth target to each fragment Render Scene from main camera for each light Render scene depth from each light

  11. Render from Shadow Camera struct Light { float3 position; float4 diffuse; float4 specular; float3 attenuation; float3 spot; }; Texture2D shadowTex : register(t0); SamplerStateshadowSamp : register(s0); Bind each shadow camera to a depth target (no color needed) Render scene depth from each light Bind each depth target to a slot in the shader

  12. Render from Main Camera Project the fragment position into the light’s space, using modified x,y for uvtexcoords Render scene from the main camera Compare depth stored in texture vs projected distance from the light

  13. Final Result High Detail (texture limited) Dynamically changing Shadow Self Shadowing Translucency effects easily added Expensive (re-render scene for each light) Detail limited by texture size Point lights are very expensive to cast shadows from (6 renders per light)

  14. Some Advanced Stuff Sampling many adjacent texels and applying noise algorith Sampling adjacent texels and blending can soften shadows Texture resolution can cause aliasing

  15. When to Use Each Technique Baked Lighting Blob Shadows Shadows Volumes Depth Map Shadows Areas that need high quality shadows from directional or spot lights [light from a window] When you need to cast from point lights or when depth maps are too expensive [Small light points, candles] Objects that are too far away to need detail, but close enough to need shadows[distant trees, buildings] Areas where lighting and geometry won’t change [ceiling of a tall building]

  16. To Do • Begin work on your enhancement • Begin work on OpenGL labs • Update wiki with all team related information • Prepare for Mid-term (read study guide)

More Related