A Hierarchical Shadow Volume Algorithm

Slides:



Advertisements
Similar presentations
An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
Advertisements

Optimized Stencil Shadow Volumes
Optimized Stencil Shadow Volumes
Two Methods for Fast Ray-Cast Ambient Occlusion Samuli Laine and Tero Karras NVIDIA Research.
1 Dr. Scott Schaefer Shadows. 2/40 Shadows Shadows provide clues about depth Make scenes appear more realistic.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
A Real-Time Soft Shadow Volume Algorithm DTU Vision days Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Sweden
1 Dynamic Shadows and Lighting for Walkthrus of Large Models Brandon Lloyd COMP 258 December 2002.
1 CSCE 441: Computer Graphics Hidden Surface Removal (Cont.) Jinxiang Chai.
Status – Week 231 Victor Moya. Summary Primitive Assembly Primitive Assembly Clipping triangle rejection. Clipping triangle rejection. Rasterization.
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
© 2004 Tomas Akenine-Möller1 Shadow Generation Hardware Vision day at DTU 2004 Tomas Akenine-Möller Lund University.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Computer Graphics Shadows
1 A Hierarchical Shadow Volume Algorithm Timo Aila 1,2 Tomas Akenine-Möller 3 1 Helsinki University of Technology 2 Hybrid Graphics 3 Lund University.
Hidden Surface Removal
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
Computer Graphics Mirror and Shadows
Shadow Algorithms Ikrima Elhassan.
Samuli Laine: A General Algorithm for Output-Sensitive Visibility PreprocessingI3D 2005, April 3-6, Washington, D.C. A General Algorithm for Output- Sensitive.
Ray Tracing and Photon Mapping on GPUs Tim PurcellStanford / NVIDIA.
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
Computer Graphics 2 Lecture 8: Visibility Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
MIT EECS 6.837, Durand and Cutler Real-Time Shadows.
2 COEN Computer Graphics I Evening’s Goals n Discuss application bottleneck determination n Discuss various optimizations for making programs execute.
Real-time Graphics for VR Chapter 23. What is it about? In this part of the course we will look at how to render images given the constrains of VR: –we.
Interactive Rendering With Coherent Ray Tracing Eurogaphics 2001 Wald, Slusallek, Benthin, Wagner Comp 238, UNC-CH, September 10, 2001 Joshua Stough.
Hidden Surface Removal
Sample Based Visibility for Soft Shadows using Alias-free Shadow Maps Erik Sintorn – Ulf Assarsson – uffe.
Computer Graphics Zhen Jiang West Chester University.
Hierarchical Penumbra Casting Samuli Laine Timo Aila Helsinki University of Technology Hybrid Graphics, Ltd.
Computer Graphics I, Fall 2010 Implementation II.
Soft Shadow Volumes for Ray Tracing
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
1 Shadow Rendering Techniques: Hard and Soft Author: Jamiur Rahman Supervisor: Mushfiqur Rouf Department of CSE BRAC University.
Hierarchical Occlusion Map Zhang et al SIGGRAPH 98.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
SHADOW CASTER CULLING FOR EFFICIENT SHADOW MAPPING JIŘÍ BITTNER 1 OLIVER MATTAUSCH 2 ARI SILVENNOINEN 3 MICHAEL WIMMER 2 1 CZECH TECHNICAL UNIVERSITY IN.
CENG 477 Introduction to Computer Graphics
- Introduction - Graphics Pipeline
Computer Graphics Implementation II
Real-Time Soft Shadows with Adaptive Light Source Sampling
A Geometry-Based Soft Shadow Volume Algorithm Using Graphics Hardware
Graphics Processing Unit
Real-Time Rendering Shadow Volumes
Hidden Surfaces Dr. Scott Schaefer.
The Graphics Rendering Pipeline
Hybrid Ray Tracing of Massive Models
Jim X. Chen George Mason University
CSCE 441: Computer Graphics Hidden Surface Removal
Alias-Free Shadow Maps
Graphics Processing Unit
Conservative Visibility Preprocessing using Extended Projections Frédo Durand, George Drettakis, Joëlle Thollot and Claude Puech iMAGIS-GRAVIR/IMAG-INRIA.
UMBC Graphics for Games
Lecture 13 Clipping & Scan Conversion
CSCE 441: Computer Graphics Hidden Surface Removal (Cont.)
Introduction to Computer Graphics with WebGL
Clipping University of British Columbia CPSC 314 Computer Graphics
GEARS: A General and Efficient Algorithm for Rendering Shadows
Presentation transcript:

A Hierarchical Shadow Volume Algorithm Timo Aila1,2 Tomas Akenine-Möller3 1Helsinki University of Technology 2Hybrid Graphics 3Lund University

Outline Brief intro to shadow volumes Our solution Results Q&A fillrate problem, existing solutions Our solution idea implementation Results Q&A

Shadow volumes [Crow77] Shadow volumes define closed volumes of space that are in shadow infinitesimal light source shadow caster = light cap dark cap extruded side quads

Is point inside shadow volume? Pick reference point R outside shadow volume any such point is OK Span line from R to point to be classified Compute sum of enter (+1) and exit (-1) events P1 shadow volume 2D illustration: R P2 P3

Using graphics hardware R at ∞ behind pixel (z-fail) [Bilodeau&Songy, Carmack] infinity always outside SVs – robust must not clip to far plane of view frustum sum hidden events to stencil buffer, sign from backface culling visible samples (or pixels) 2D illustration: - + camera R + - + shadow volume view frustum

Amount of pixel processing Adapted from [Chan and Durand 2004]

Fillrate problem 50+ fps without shadows on ATI Radeon 9800XT at 1280x1024, 1 sample/pixel 1 fps when shadow volumes rasterized 2.2 billion pixels per frame

Existing solutions (1/2) CC shadow volumes [Lloyd et al. 2004] draw SVs only where receivers exist good when lots of empty space Hybrid shadow maps and volumes [Chan&Durand 2004] use SVs only at shadow boundaries boundary pixels determined using shadow map artifacts due to limited shadow map resolution

Existing solutions (2/2) Depth bounds [Nvidia 2003] application supplies min & max depth values separately for each shadow volume rasterize shadow volume only when visible geometry between [min,max] optimal bounds hard to compute min max camera 2D illustration: shadow volume visible pixels

Outline Brief intro to shadow volumes Our solution Results Q&A fillrate problem, existing solutions Our solution idea implementation Results Q&A

Reference image

Shadow volume algorithm executed once per 8x8 pixel tile

Green tiles may contain shadow boundary - other tiles were correct

Low-res (gray) + per-pixel computed boundaries (dark)

How to detect shadow boundaries? Two facts about shadow volumes always closed SV triangles mark potential shadow boundaries If 3D volume in scene not intersected by shadow volume triangles fully lit or fully in shadow single sample classifies entire volume

Outline Brief intro to shadow volumes Our solution Results Q&A fillrate problem, existing solutions Our solution idea implementation Results Q&A

Detecting boundary tiles Bound tile with axis-aligned bounding box 8x8 pixel region Zmin, Zmax Triangle vs. AA Box intersection test low-resolution rasterization Zmin and Zmax tests 8 8 pixels Zmax Zmin

Fast update of non-boundary tiles Copy low-res shadows to stencil buffer writing 64 per-pixel values would be slow Two-level stencil buffer saves the day maintain [Smin, Smax] per tile always test the higher level first often no need to validate per-pixel values stencil values of non-boundary tiles are constant

Implementation – Stage 1 SV triangles Boundary? Low-res shadows Low-resolution rasterizer Per-tile operations Buffers built separately for each shadow volume Classifications ready when entire SV processed application marks begin/end of shadow volumes

Implementation – Stage 2 Boundary? Low-res shadows SV triangles Low-resolution rasterizer boundary tile? No Copy to 2-level stencil Yes Per-pixel rasterizer Stencil ops Update 2-level stencil

Alternative implementations Two pass Pass 1 = Stage 1 Pass 2 = Stage 2 How to keep pixel units busy during Stage 1? maybe assign per-tile operations to pixel shaders? Single pass Separate stages using delay stream [Aila et al. 2003] Stage 2 of current SV executes simultaneously with next SV’s Stage 1

Hardware resources Two-level stencil buffer Per-tile operations Optionally delay stream * duplicate low-res rasterizer & Zmin/Zmax units * cache for per shadow volume buffers multiple buffers for pipelined operation allocate from external memory * If not already there for occlusion culling purposes

Outline Brief intro to shadow volumes Our solution Results Q&A fillrate problem, existing solutions Our solution idea implementation Results Q&A

Results – Simple scene (1280x1024) Depth bounds Hierarchical Improvement Ratio in #pixels 1.1 12.7 11.5 Ratio in bandwidth 1.03 17.6 17.2

Results – Knights (1280x1024) Ratio in #pixels 2.6 7.4 2.8 Depth bounds Hierarchical Improvement Ratio in #pixels 2.6 7.4 2.8 Ratio in bandwidth 2.4 5.6

Results – Powerplant (1280x1024) Depth bounds Hierarchical Improvement Ratio in #pixels 2.4 22.9 9.5 Ratio in bandwidth 2.3 16.0 6.9

Summary Hierarchical rendering method for shadow volumes Future work significant fillrate savings compared to other hardware methods also works for soft shadow volumes Future work would it make sense to extend programmability to per-tile operations? how many pipeline bubbles are created? requires chip-level simulations

Thank you! Questions? Acknowledgements Ville Miettinen, Jacob Ström, Eric Haines, Ulf Assarsson, Lauri Savioja, Jonas Svensson, Ulf Borgenstam, Karl Schultz, 3DR group at Helsinki University of Technology The National Technology Agency of Finland, Hybrid Graphics, Bitboys, Nokia and Remedy Entertainment ATI for granting fellowship to Timo (2004-2005)