Download presentation
Presentation is loading. Please wait.
1
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University of Technology Sweden
2
Copyright 2002 Tomas Akenine-Möller Why shadows? Why soft?
3
Copyright 2002 Tomas Akenine-Möller Our goal is plausible soft shadows in real time Soft shadow generation is a fundamental CG problem Many algorithms exist… Not a single one that can be used in, e.g., a game We (all) want –Good performance (use hardware) –Arbitrary receivers and casters –Plausible, or even better, physically-correct shadows Our paper is one small step in the right direction
4
Copyright 2002 Tomas Akenine-Möller Previous work on real-time shadows Lots… Most important algorithms for shadows on arbitrary surfaces: –Shadow Mapping [Williams] See ”Perspective Shadow Maps”, SIGGRAPH 2002 Heidrich et al, EGRW2000, soft version –Shadow Volumes [Crow,Heidmann] See Everitt and Kilgard’s report on how to robustly render shadow volumes
5
Copyright 2002 Tomas Akenine-Möller Some previous work on real-time soft shadow generation Heckbert/Herf [HH]: –average a high number of images from point samples on light source, use as a texture on a plane –Uses many passes: 64-256 (or fewer, and banding artifacts) –Not practical for dynamic scenes Soler/Sillion [SS]: –For planar configurations, convolve hard shadow with shape of light source –Fast –Hierarchical error-driven algorithm –Image-based can use any shadow casting geometry and light source [same for HH] Haines’ plateaus: –Planar as well –Overemphasize the umbra –Few passes
6
Copyright 2002 Tomas Akenine-Möller Our idea Extend the shadow volume algorithm –And use ideas from Haines’ work In the shadow volume algorithm, each silhouette edge shadow quad For soft shadows, instead each edge a wedge- like shape: penumbra wedge
7
Copyright 2002 Tomas Akenine-Möller In 3D, things are more complicated… so make some simplifying assumptions Simplifications: –Spherical light sources –Only use silhouette as seen from center of light source –Bound the penumbra volume with 4 planes, sharing a silhouette edge Also, use a hires stencil buffer (we use 16 bits) – called light intensity buffer here
8
Copyright 2002 Tomas Akenine-Möller How to rasterize a wedge… Init light intensity (LI) buffer to 255 before 255 = full light, 0 = no light, 0 < x < 255 penumbra
9
Copyright 2002 Tomas Akenine-Möller wedge Front plane back plane Examples of rasterization in 2D Next, describe missing pieces: –Construction of wedges –Light intensity interpolation 255 LI-buffer =255 0 + ( 0 – 255 ) = 0 (umbra) 255 0 100
10
Copyright 2002 Tomas Akenine-Möller Penumbra wedge construction
11
Copyright 2002 Tomas Akenine-Möller Light intensity interpolation To make it possible to implement using programmable hardware: –Our only requirement was C 0 continuity across wedges (side planes) First attempt: –Compute positive intersection distances ( t f and t b ) to front and back plane –Then s=t b /(t f +t b ) –Occasional artifacts 2nd try:
12
Copyright 2002 Tomas Akenine-Möller Implementation Need pretty large vertex & pixel shaders in order to implement using graphics hw So currently: –Render scene using hw-accelerated OpenGL –Read back Z-buffer –Software wedge rasterization into LI-buffer (some optimizations not covered here – see paper) For each pixel (x,y) get z and form the world-space coordinates Point inside wedge compute light intensity –When all wedges rasterized Clamp to [0,255] and modulate specular + diffuse image, and then add ambient image
13
Copyright 2002 Tomas Akenine-Möller Results: simple scene, comparison with Heckbert/Herf and Soler/Sillion Our algorithm 2 fps using SW Heckbert/Herf 128 samples 20 fps using HW Soler/Sillion [worst case for this algorithm]
14
Copyright 2002 Tomas Akenine-Möller Results: increasing light source size, and complex shadow receiver 1.8 fps on a 1.5 GHz PC
15
Copyright 2002 Tomas Akenine-Möller Fractal landscape as shadow receiver 100k triangles
16
Copyright 2002 Tomas Akenine-Möller Two lights Demo
17
Copyright 2002 Tomas Akenine-Möller Problems with our algorithm Acute angles in shadow casting geometry Only used spherical light sources We use silhouette from center of light source (like Haines) Due to our construction of wedges, we can only render soft shadows for silhouettes that form closed loops –Limits the types of shadow casting geometry Non-robust creation of side planes when silhouette edge is near-parallel to incoming light –Hack to avoid: remove such edges, and shorten & reconnect neighbors Original result Expected result [HH]Our algorithm using 6 extra wedges per acute angle
18
Copyright 2002 Tomas Akenine-Möller Future and Current Work We’ve added occlusion culling… …and dealt with eye-in- shadow problem Demo Late, late, late results –Use a penumbra wedge to bound the exact penumbra volume –Much more accurate light intensity computation –Allows us to use arbitrary shadow casting geometry –Most artifacts disappear
19
Copyright 2002 Tomas Akenine-Möller Future work Qualitative analysis of errors –When do they occur? –And when do we care/not care? Accurate comparison to other algorithms More light source shapes Implementation using –New graphics hardware (large pixel shader program) –Use HILO texture as LI buffer
20
Copyright 2002 Tomas Akenine-Möller Thanks for listening!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.