Download presentation
Presentation is loading. Please wait.
Published byMeghan Gaines Modified over 5 years ago
1
GEARS: A General and Efficient Algorithm for Rendering Shadows
Lili Wang1, Shiheng Zhou1, Wei Ke2,Voicu Popescu3 1State Key Laboratory of Virtual Reality Technology and Systems, Beihang University 2Macao Polytechnic Institute, Macau 3Purdue University, West Lafayette
2
Contents Motivation Related work Algorithm Acceleration Results
Limitations Conclusion 1
3
Motivation Shadow for Realistic rendering
Area lights give soft shadows Point light Area light 2
4
Motivation Ray Tracing is a solution, multiple rays for each sample. But slow. Challenge is to estimate what fraction of an area light source is visible from each of the surface pixel samples in real time. A pixel Lots of shadow rays per pixel Area light 3
5
Related work shadow simulation methods shadow approximation methods 1
Screen-space percentage closer soft [MOHAMMADBAGHER M.et al.2010] Percentage-closer soft shadows [FERNANDO R.2005] Approximate soft shadows with an image-space flood-fill algorithm [ARVO J. et al.2004] shadow approximation methods Highquality adaptive soft shadow mapping. [GUENNEBAUD G.et al.2007] Microquad soft shadow mapping revisiteds. [SCHWARZ M. et al. 2008] Packet-based hierarchal soft shadow mapping.[YANG B. et al.2009] [MOHAMMADBAGHER M.et al.2010] [YANG B. et al.2009] 1 4
6
Related work Accurate soft shadow methods
Alias-free shadow maps [AILA T. et al 2004] Samplebased visibility for soft shadows using alias-free shadowmaps [SINTORN E. et al.2008] Efficient ray traced soft shadows using multi- frusta tracing[BENTHIN.C. et al. 2009] Visibility sampling on gpu and applications [EISEMANN E. et al. 2007] [AILA T. et al 2004] [SINTORN E. et al.2008 1 5
7
Algorithm - Basic solution
. Replace the shadow rays With rendering all triangles on visibility bit mask Construct a camera frustum containing sample rays Fractional visibility per pixel can be computed A pixel Area light Area light 6 Lots of shadow rays per pixel Resterize triangles on visibility bit mask
8
Algorithm - Basic solution
Replace the shadow rays With rendering all triangles on visibility bit mask Construct a camera with pixel sample as its eye and the light as its image plane Fractional visibility per pixel is computed as the percentage of unoccluded light samples visibility mask (resolution) Render triangles Light source Shadow caster triangles Pixel sample as a camera 7
9
Algorithm GEARS algorithm 8
Compute the output image without the soft shadows Unproject each pixel p in I0I1 to pixel sample P Assign all tris. to pixel samples P.(acceleration is introduced later) For each P, compute the frac. visibility vp of L0L1 Construct camera Render with PL0L1 all blocking triangles Compute vp as the percentage of unoccluded light samples Add the contribution of light L0L1 to each pixel p of I0I1 using the computed fractional visibility vp. 8
10
Acceleration- Finding potential triangles
Assign all tris. to pixel samples is naïve Time Memory A small portion of triangles are blocking We want to find the potential blocking triangles per pixel HOW? 9
11
Acceleration- Finding potential triangles
Generating grid cells in light space Triangles and samples are transferred in a light space Assign triangles to all the cells that are touched by the projection of area light Projecting pixel samples with camera and assign them to the grid cells. Pixels in a same cell shares the blocking triangles Spatial coherence 10
12
Acceleration- Generating grid cells
Generating light camera : View frustum of camera contains 3-D AABB of all sample pixels. The far plane is given by the farthest corner of the 3-D AABB. 11
13
Acceleration- Triangle to cell assignment
A triangle is assigned to : All grid cells for which the triangle might block the light. Established a mapping from triangles to cells by pairs (triID; cellID) . 12
14
Acceleration- Invert the mapping
Creates an array of pairs (triID; cellID) by calculating all the cellsN touched by the triangle Mapping needs to be inverted to be able to retrieve the triangles that potentially block a given cell. computed in parallel by radiax sorting 13
15
Acceleration- Rasterize potential triangles
For a given pixel we find the potential triangles in the sorted array from the begin to the end of belonging cell. Rasterize Construct a camera with pixel sample as its eye and the light as its image plane Scan line rasterization Bit mask is computed Fractional visibility is computed as the percentage of unoccluded light samples 14
16
Result - Quality Soft shadows rendered with GEARS compared to that of ray tracing – No Difference ! Our Method Ray-tracing 15
17
Result - Quality Soft shadows rendered with GEARS compared to that of ray tracing, dynamic scene with tree moving in winds – No Difference ! 16 Our Method Ray-tracing
18
Result - Quality Video 17
19
Result - Quality Quality dependence on resolution of visibility masks –Better results with higher resolution 4x4 8x8 16x16 32x32 18
20
Results - Performance Our method is between 10 and 25 times higher than ray tracing. Scene GEARS [fps] (A) RT static (B) Speedup (A)/(B) RT dyn. (C) Chess 29.8 2.91 10 2.52 12 Church 36.2 3.72 3.05 Dragon 38.7 4.01 2.96 13 Bird Nest 26.5 1.07 25 0.95 28 Spider 75.6 5.33 15 3.54 22 Garden 21.4 1.98 11 1.65 19
21
Results - Performance Quality comparison between GEARS and ray tracing for equal time performance GEARS ray tracing GEARS ray tracing 20
22
Results - Performance Average frame rate for our test scenes for various output image resolutions Frames per second Image resolution 512x512 1024x1024 1280x1280 Cow Matrix 30.5 20.2 13.4 Chess 29.8 19.9 11.8 Church 36.2 17.1 12.3 Dragon 38.7 15.6 11.9 Bird Nest 26.6 11.3 8.8 Spider 75.6 40.8 27.7 Garden 21.4 11.4 9.0 21
23
Results - Performance Frame rate for various visibility mask resolutions. Bit mask res 4x4 8x8 16x16 32x32 Chess 36.7 35.6 29.8 22.0 Church 51.0 44.3 36.2 21.7 Dragon 48.7 46.2 38.7 24.9 Bird Nest 57.7 55.3 26.5 16.0 Spider 11.6 110.0 75.6 48.4 Garden 34.2 30.1 21.4 15.2 22
24
Limitations Blockers have to be large enough for their projection to be detected. Regular grid is used which is an inefficient modeling of non-uniform sampling Edges of blocking geometry exhibit some degree of temporal aliasing Cannot efficiently support a set of disparate point light sources 23
25
Conclusion GEARS is an algorithm for computing Soft Shadows
General: support fully dynamic scenes, scenes without restrictions Efficient: fast to compute and tight Accurate: guaranteed to render all triangles that block the light 24
26
Thanks Q&A
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.