Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller...
Transcript of Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller...
![Page 1: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/1.jpg)
Soft Shadows
COMP 770 Computer GraphicsQi Mo
![Page 2: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/2.jpg)
Why Soft Shadows?
![Page 3: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/3.jpg)
• Visibility function• Between light source and every point
ChallengeChallenge
![Page 4: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/4.jpg)
Anatomy of Soft Shadows
![Page 5: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/5.jpg)
Previous Work
• Geometry-based methods- Shadow-volume-based
• Image-based methods- Shadow-map-based
![Page 6: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/6.jpg)
Review: Shadow Volumes
point light
eye
occluder
parity=0 parity=1 parity=0
00
0
1
1
0
![Page 7: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/7.jpg)
Pros and Cons
• Pros- No aliasing- Unlimited light field of view
• Cons- Poor scalability with scene complexity- Fill-rate limited- Polygonal models only
![Page 8: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/8.jpg)
Review: Shadow Maps
Light
Eye-ray nearest intersection point
Light-ray nearest intersection point
L
E
![Page 9: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/9.jpg)
Pros and Cons
• Pros- Efficiency and scalability- Polygons, parameterized surfaces,
alpha textures, etc.• Cons
- Shadow aliasing and acne- No omni-directional light
![Page 10: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/10.jpg)
Methods to cover
• Distributed ray tracing soft shadows
• Penumbra wedges • Soft shadow volumes
• Soft shadow mapping by backprojection
![Page 11: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/11.jpg)
Methods to cover
• Distributed ray tracing soft shadows
• Penumbra wedges • Soft shadow volumes
• Soft shadow mapping by backprojection
![Page 12: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/12.jpg)
![Page 13: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/13.jpg)
![Page 14: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/14.jpg)
![Page 15: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/15.jpg)
![Page 16: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/16.jpg)
![Page 17: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/17.jpg)
![Page 18: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/18.jpg)
![Page 19: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/19.jpg)
![Page 20: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/20.jpg)
![Page 21: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/21.jpg)
![Page 22: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/22.jpg)
![Page 23: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/23.jpg)
![Page 24: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/24.jpg)
![Page 25: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/25.jpg)
![Page 26: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/26.jpg)
Methods to cover
• Distributed ray tracing soft shadows
• Penumbra wedges• Soft shadow volumes
• Soft shadow mapping by backprojection
![Page 27: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/27.jpg)
Penumbra Wedges
Tomas Akenine-MöllerUlf Assarsson
Department of Computer Engineering,Chalmers University of Technology
Sweden
![Page 28: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/28.jpg)
Idea• Extend the shadow volume algorithm• In the shadow volume algorithm
each silhouette edge � shadow quad• For soft shadows, instead
each edge � penumbra wedge
![Page 29: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/29.jpg)
In 3D, ...
• Simplifications:– Spherical light sources– Only use silhouette as
seen from center of light source
– Bound the penumbravolume with 4 planes, sharing a silhouetteedge
• Also, use a hiresstencil buffer (we use16 bits) – called light intensity buffer here
![Page 30: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/30.jpg)
How to rasterize a wedge…• Init light intensity (LI) buffer to 255 before• 255 = full light, 0 = no light, 0 < x < 255 � penumbra
![Page 31: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/31.jpg)
wedge
Front planebackplane
Examples of rasterization in 2D
• Next, describe missing pieces:– Construction of wedges– Light intensity interpolation
255
LI-buffer =255
0
+ ( 0 – 255 ) = 0 (umbra)
2550255 100
![Page 32: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/32.jpg)
Penumbra wedge construction
![Page 33: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/33.jpg)
Light intensity interpolation
• To make it possible to implement using programmablehardware:– Our only requirement was C0
continuity across wedges (sideplanes)
![Page 34: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/34.jpg)
Results
![Page 35: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/35.jpg)
Methods to cover
• Distributed ray tracing soft shadows
• Penumbra wedges • Soft shadow volumes
• Soft shadow mapping by backprojection
![Page 36: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/36.jpg)
Soft Shadow Volumes for Ray Tracing
Timo Aila
Helsinki University of Technology,
Hybrid Graphics Ltd.
Samuli Laine
Helsinki University of Technology,
Hybrid Graphics Ltd.
Ulf Assarsson
ARTIS, GRAVIR /IMAG INRIA,
Chalmers University of Technology
Jaakko Lehtinen
Helsinki University of Technology,
Remedy Entertainment Ltd.
Tomas Akenine-Möller
Lund University
![Page 37: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/37.jpg)
Classic solution
• Multiple shadow rays
pixelpixel
Lots of shadow rays per pixel
![Page 38: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/38.jpg)
New solution - overview
• Replace the shadow rays– With soft shadow volume computations– Plus one reference shadow ray
pixel
Lots of shadow rays per pixel
pixel
One shadow ray + soft shadow volume computations
Classic approach Our approach
![Page 39: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/39.jpg)
What’s a Soft Shadow Volume?
Soft Shadow Volume =A. Volume from which an edge projects
onto the light sourceB. Region of penumbra caused by an
edge
Light source
Soft Shadow Volume
Shadow caster
![Page 40: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/40.jpg)
Wedge Creation Criterions
1. Wedges are created for all edges that are silhouettes from any point on the light source
2. The wedge includes all positions from which the edge projects onto (occludes) the light source.
![Page 41: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/41.jpg)
Two parts:• from any receiving point p,
we need to find silhouette edges affecting the visibility
• A method for computing the visibility from silhouette information
Our solution - overviewOur solution - overview
![Page 42: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/42.jpg)
Bottom face of hemicube
hemicube
Each cell contains list of edges
Hemicube Construction
Rasterize soft shadow volumes into a hemicube for each light source
Each cell contains list of edges
pp
This cell contains potential silhouette edges from pp
![Page 43: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/43.jpg)
Bottom face of hemicube
Rasterize soft shadow volumes into a hemicube for each light source
Each cell contains list of edges
Wedge marked to all cells it even partially overlaps → no artifacts
Hemicube ConstructionHemicube Construction
![Page 44: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/44.jpg)
Bottom face of hemicube
Each cell contains list of edges
Wedge marked to all cells it even partially overlaps → no artifacts
Hemicube ConstructionHemicube Construction
![Page 45: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/45.jpg)
Visibility Reconstruction
• Which light samples si are visible from point p?
• Brute force: cast a shadow ray for each si
• Our recipe:1. Find silhouette edges between p and light
source2. Project them onto light source � reduces to 2D3. Compute relative depth complexity for every si
4. Solve visibility with a single shadow ray5. Profit
![Page 46: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/46.jpg)
Depth Complexity
• Depth complexity of si = number of surfaces between p and si
1
11
1 0
0
2
Light source as seen from p Depth complexity function
0�
![Page 47: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/47.jpg)
• Projected silhouette edges define the first derivative of the depth complexity function
• Hence, relative depth complexity can be solved by integrating the silhouette edges over the light source
• Integration islinear � can beperformed oneedge at a time
From Silhouette Edges to Relative Depth Complexity
1
11
1 00
2�
![Page 48: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/48.jpg)
Integration: Example
• Left-to-right integration of a triangular silhouette
Light source as seen from p Depth complexity function
� +1
-1
-10 1
1
0
1
![Page 49: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/49.jpg)
Integration: Sampling Points
• We don’t need the value of the depth complexity function except at the sampling points si
• Sufficient to maintain a depth complexity counter for each si
• Integration: find si that are insideupdate region and update theirdepth complexity counters
+1
![Page 50: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/50.jpg)
• There’s a caveat - we only have the edges that overlap the light source
• Loops are not necessarily closed, since parts outside the light source may be missing
Integration: Rules
We don’t have this edge!
![Page 51: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/51.jpg)
• Solution: apply special rules to edges that cross the left side of the light source
• This accountsfor potentiallymissing edges
Integration: Rules
![Page 52: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/52.jpg)
• We are not done yet, since the constant of integration is not known � cannot solve visibility
• Solution: cast a shadow rayray to one si with lowestrelative depth complexity
• If blocked, all si are blocked• Otherwise, all si with lowest rel.
depth complexity are visible
From Relative Depth Complexity to Visibility
![Page 53: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/53.jpg)
Columns: 580 triangles, adaptive AA, 960x540
242103Speedup factor
L = 1024L = 256
![Page 54: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/54.jpg)
Formula: 60K triangles, adaptive AA, 960x540
6530Speedup factor
L = 800L = 200
![Page 55: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/55.jpg)
Sponza: 109K triangles, adaptive AA, 960x540
3311Speedup factor
L = 600L = 150
![Page 56: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/56.jpg)
Robots: 1.3M triangles, adaptive AA, 960x540
5821Speedup factor
L = 800L = 200
![Page 57: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/57.jpg)
Ring: 374K triangles, adaptive AA, 960x540
3213Speedup factor
L = 600L = 150
![Page 58: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/58.jpg)
Conclusions
• Fast shadow algorithm in wide range of scenes
• Easy to plug into an existing ray tracer• Scalability considerations
– Number of light samples: excellent (~ sqrt M)– Number of triangles: good (silhouettes: ~ N(something ≤ 1))– Output resolution: not so good (linear)– Spatial size of the light source: not so good (~ linear)
![Page 59: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/59.jpg)
Methods to cover
• Distributed ray tracing soft shadows
• Penumbra wedges • Soft shadow volumes
• Soft shadow mapping by backprojection
![Page 60: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/60.jpg)
![Page 61: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/61.jpg)
![Page 62: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/62.jpg)
![Page 63: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/63.jpg)
![Page 64: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/64.jpg)
![Page 65: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/65.jpg)
![Page 66: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/66.jpg)
![Page 67: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/67.jpg)
![Page 68: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/68.jpg)
![Page 69: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/69.jpg)
![Page 70: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/70.jpg)
![Page 71: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/71.jpg)
![Page 72: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/72.jpg)
![Page 73: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/73.jpg)
Geometry-based Methods• Discontinuity mesh and backprojection�Penumbra wedges�Soft shadow volumesImage-based Methods• Multi-layered shadow map• Extended shadow map�Soft shadow mapping by backprojectionOther Methods• Occlusion camera• Spherical harmonics�Ray tracing/Radiosity
![Page 74: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/74.jpg)
Summary
• Performance / Scalability• Polygonal scenes or Other scenes• Plausible or Physically accurate• Common artifacts
- Single sample artifact- Occlusion fusion artifact
![Page 75: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/75.jpg)
Single Sample Artifact
![Page 76: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/76.jpg)
Occlusion Fusion Artifact
![Page 77: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/77.jpg)
Reading List
• Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges.” 13th Eurographics Workshop on Rendering 2002, pp. 309-318, June 2002.
• Samuli Laine, Timo Aila, Ulf Assarsson, Jaakko Lehtinen and Tomas Akenine-Möller, “Soft Shadow Volumes for Ray Tracing." ACM SIGGRAPH 2005.
• Randima Fernando, “Percentage-closer soft shadows.” ACM SIGGRAPH 2005 Sketches.
• Gaël Guennebaud, Loïc Barthe and Mathias Paulin. “Real-time Soft Shadow Mapping by Backprojection.” Eurographics Symposium on Rendering 2006
![Page 78: Soft Shadows - Computer Sciencedm/UNC/COMP236/LECTURES/SoftShadows.pdf · • Tomas Akenine-Möller and Ulf Assarsson, “Approximate Soft Shadows on Arbitrary Surfaces using Penumbra](https://reader036.fdocuments.us/reader036/viewer/2022071105/5fdf64b1784fd452134e6e7b/html5/thumbnails/78.jpg)
Additional Reference
• A survey of Real-Time Soft Shadows Algorithms
http://artis.inrialpes.fr/Publications/2003/HLHS03a/
• Shadow Rendering Page at Lund Universityhttp://graphics.cs.lth.se/research/shadows/
• Real-time Renderinghttp://www.realtimerendering.com/