Introduction STSV Implementation Conclusion
Soft Textured Shadow Volume Vincent Forest1 , Lo¨ıc Barthe1 , Ga¨el Guennebaud2 , Mathias Paulin1 1 University 2 INRIA
of Toulouse IRIT-CNRS, France Bordeaux-Sud Ouest, France
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
1/22
Introduction STSV Implementation Conclusion
1
Introduction
2
Soft textured shadow volume
3
Implementation and performances
4
Conclusion
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
2/22
Introduction STSV Implementation Conclusion
Shadows in computer graphics Perception of the emitter-receiver visibility Problematic: how to evaluate the emitter-receiver visibility? Why shadows? Enhance realism Give visual clue on the scene organization How to compute shadows? Ray-traced shadows Naturally handle, robust, expensive
Rasterized shadows Specific algorithm, hardly robust, accelerated by GPU
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
3/22
Introduction STSV Implementation Conclusion
Rasterizing shadows
Image-based framework Lie on the rasterization visibility background Naturally fit into current graphics hardware General and robust image-based shadows algorithm are painful Object-based framework Object precision Far less fragile than image-based shadows ”Object-based performances”
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
4/22
Introduction STSV Implementation Conclusion
Object-based shadows Accurate hard shadows
[Cro77]
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
5/22
Introduction STSV Implementation Conclusion
Object-based shadows Accurate textured hard shadows
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
[HAM07]
Soft Textured Shadow Volume
5/22
Introduction STSV Implementation Conclusion
Object-based shadows Accurate soft shadows
[FBP08]
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
5/22
Introduction STSV Implementation Conclusion
Problematic Accurate soft textured shadows?
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
5/22
Introduction STSV Implementation Conclusion
Soft Textured Shadow Volume (STSV)
Compute soft object-based shadows casted by textured triangles Spatially varying transmittance property (S-triangle) Merge soft [ADMAM03] and textured [HAM07] shadow volumes Extrude a per S-triangle conservative volume to define its shadow influence Problematic Which receivers lie in soft textured shadows? How are receivers directly illuminated?
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
6/22
Introduction STSV Implementation Conclusion
Which receivers lie in soft textured shadow? It is an object-based approach! Extrude a volume Rasterize it Soft textured shadow volume Conservative volume of the soft textured shadow region Light
n1 n2
Front cap t'
n2 n1 Extruded outer-quads
S-triangle t
n2 n0 n0 n0 n1
Z-fail rasterization of the STSV Interpolation algorithm [HAM07] V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
7/22
Introduction STSV Implementation Conclusion
How are receivers directly illuminated? Project each light sample s onto the S-triangle plane Retrieve barycentric coordinates of the projected light sample J
s0 =
z }| { s0h = S · W · M 0 ·s
1 s0h .z
Evaluate M 0 and S per S-triangle
«
Light samples
Compute J once per receiver point Is s effectively occluded by the S-triangle?
s0h .x s0h .y
„
Projected samples
s∗h = J · s
S-triangle
(s∗h .x > 0) and (s∗h .y > 0) and (s∗h .z − s∗h .x − s∗h .y > 0) Receiver
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
8/22
Introduction STSV Implementation Conclusion
Transmittance & visibility
Visibility is fetched from the transmittance texture Use s0 to access the texture Binary transmittance Radiance is blocked or transmitted Low memory consumption Well suited to the Z-buffer visibility algorithm
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
9/22
Introduction STSV Implementation Conclusion
STSV & Penumbra Wedge [ADMAM03] From light sample visibility to visibility coefficient Average the visibility query between the visible surface point x and each s on the light k Vcoef (k ↔ x) =
1 X 1 V (s ↔ x) |Lk | p (s) s ∈ Lk
Artifact free Vcoef : no overlapping artifact! Add the STSV and the PWedge Vcoef Common PWedge overlapping artifact
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
10/22
Introduction STSV Implementation Conclusion
STSV & Depth Complexity Sampling [FBP08]
Straightforward combination! Define the visibility from the transmittance texture Update the depth complexity Overhead? Update the DC counters and nothing more... Direct lighting computed by the DCS
No memory cost No additional data structure No specific light sample distribution
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
11/22
Introduction STSV Implementation Conclusion
STSV & VS Ray-tracing [mi]
STSV + PWedge
STSV + DCS
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
RT
12/22
Introduction STSV Implementation Conclusion
Implementation overview
Initialize the indirect lighting and the Z-buffer with a first pass Use any indirect lighting algorithm [RH01] Separate opaque occluders from perforated ones PWedge/DCS on opaque triangles STSV on S-triangles
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
13/22
Introduction STSV Implementation Conclusion
STSV Implementation STSV extrusion Performed on GPU with a geometry program Few vertices rather than a tight bounding volume Light S-triangle t
2
0 1
0
1
0 2
2
3 5 4
Soft Textured Shadow Volume
4 5 3 4 3 triangle strip: 3452304120
Transmittance sampling Pre-compute light sample distribution Reduce variance with adapted sampling strategies V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
[PH04] 14/22
Introduction STSV Implementation Conclusion
STSV and DCS Z-Buffer Initialize Ambient + Z-Buffer Perforated geometry
Color Buffer (RGB)
Detect Silhouettes
Geometry
Shadow Volumes
Color Buffer (Alpha)
TFB
Init Z-Complexity
Update Z-Complexity
DCS Buffers
(Penumbra Wedges)
Update Z-Complexity (STSV)
Direct Illumination
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Color Buffer (RGB)
Soft Textured Shadow Volume
15/22
Introduction STSV Implementation Conclusion
Test environment Hardware: CoreTM 2 Duo 3Ghz, Geforce GTX−280 Software: OpenGL 2.1, NV gpu program4 shaders Test scenes: #polygons / #S-triangles / #lights
582, 512 / 14 / 4
1, 396, 078 / 26, 150 / 3
Comparison with Soft Shadow Mapping Shadow map resolution
84, 712 / 4002 / 2
[GBP07, SS07]
10242
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
16/22
Introduction STSV Implementation Conclusion
Performances 3.52 5.7
HL2 1024²
2.13 5.5 8.8
HL2 DVD
3.55 4.23 3.33
Factory 1024²
1.41 0.59 6.26 5.16
Factory DVD
2.34 1.09
PWedge+STSV64 (DCS+STSV)16 (DCS+STSV)64 SSM1024
0.6 0.77
Greece 1024²
0.3 4.74 0.93 1.26
Greece DVD
0.49 5.97
0
1
2
3
4
5
6
7
8
9
10
Figure: Frame-rate
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
17/22
Introduction STSV Implementation Conclusion
Quality
SSM 10242
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
STSV + DCS 64
Soft Textured Shadow Volume
18/22
Introduction STSV Implementation Conclusion
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
19/22
Introduction STSV Implementation Conclusion
Contributions
Soft shadows on non opaque triangles Breaking down a strong limitation of object based shadows Unified and efficient robust shadow framework Interactive results on fully dynamic real scenes Independent of the scene Scale Animation Organization ”Representation”
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
20/22
Introduction STSV Implementation Conclusion
Discussion and perspectives Per-triangle treatment! S-triangle represents complex thin geometries
STSV - 90fps
DCS - 3fps
STSV and DCS: Multiple importance depth complexity sampling? Sampling according to the light and the BSDF importance Glossy direct lighting [VG95] V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
21/22
Introduction STSV Implementation Conclusion
Thanks!
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
22/22
Introduction STSV Implementation Conclusion
Ulf Assarsson, Michael Dougherty, Michael Mounier, and Tomas Akenine-M¨ oller. An optimized soft shadow volume algorithm with real-time performance. In Proc. SIGGRAPH/EUROGRAPHICS Conference on Graphics hardware, pages 33–40. Eurographics, 2003. Franklin C. Crow. Shadow algorithms for computer graphics. In Proc. SIGGRAPH, pages 242–248. ACM Press, 1977. Vincent Forest, Lo¨ıc Barthe, and Mathias Paulin. Accurate shadows by depth complexity sampling. Computer Graphics Forum, Proc. EUROGRAPHICS, 27(2):663–674, 2008. Gael Guennebaud, Loc Barthe, and Mathias Paulin. High-quality adaptive soft shadow mapping. V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
22/22
Introduction STSV Implementation Conclusion
Computer Graphics Forum, Proc. EUROGRAPHICS, 26(3):525–533, 2007. Jon Hasselgren and Thomas Akenine-M¨ oller. Textured shadow volumes. Journal of Graphics Tools, 12(4):59–72, 2007. mental images. mental ray renderer. http: //www.mentalimages.com/products/mental-ray.html. Matt Pharr and Greg Humphreys. Physically Based Rendering: From Theory to Practice, chapter Monte Carlo Integration I: Basic Concepts, pages 631–660. Morgan Kaufmann, 2004. Ravi Ramamoorthi and Pat Hanrahan. An efficient representation for irradiance environment maps. In Proc. SIGGRAPH, pages 497–500. ACM Press, 2001. V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
22/22
Introduction STSV Implementation Conclusion
Michael Schwarz and Marc Stamminger. Bitmask soft shadow. Computer Graphics Forum, Proc. EUROGRAPHICS, 26(3):515–524, 2007. Eric Veach and Leonidas J. Guibas. Optimally combining sampling techniques for monte carlo rendering. In Proc. SIGGRAPH, pages 419–428. ACM Press, 1995.
V. Forest, L. Barthe, G. Guennebaud and M. Paulin
Soft Textured Shadow Volume
22/22