A Real-Time Soft Shadow Volume Algorithm DTU Vision days Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Sweden2003-06-13.

Slides:



Advertisements
Similar presentations
Real-Time Rendering 靜宜大學資工研究所 蔡奇偉副教授 2010©.
Advertisements

Exploration of advanced lighting and shading techniques
An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Optimized Stencil Shadow Volumes
Game Programming 09 OGRE3D Lighting/shadow in Action
Computer Graphics methods
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
Computer Graphics Visible Surface Determination. Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Shadows.
Rendering Fake Soft Shadows with Smoothies Laboratory for Computer Science Massachusetts Institute of Technology Eric Chan Frédo Durand.
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
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.
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 Geometry-based Soft Shadow Volume Algorithm using Graphics Hardware Speaker: Alvin Date:2003/7/23 SIGGRAPH 2003 Ulf Assarsson Tomas Akenine-Moller.
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
Shadow Algorithms Gerald Matzka Computer Science Seminar.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
Creating soft shadows Computer Graphics methods Submitted by: Zusman Dimitry.
Game Engine Design ITCS 4010/5010 Spring 2006 Kalpathi Subramanian Department of Computer Science UNC Charlotte.
© 2004 Tomas Akenine-Möller1 Shadow Generation Hardware Vision day at DTU 2004 Tomas Akenine-Möller Lund University.
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.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
9/20/2001CS 638, Fall 2001 Today Finishing Up Reflections More Multi-Pass Algorithms Shadows.
Under the Hood: 3D Pipeline. Motherboard & Chipset PCI Express x16.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
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
Aaron Schultz. Idea: Objects close to a light shadow those far away. Anything we can see from the light’s POV is lit. Everything hidden is dark. Distance.
Shadow Algorithms Ikrima Elhassan.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
CHAPTER 11 Shadows © 2008 Cengage Learning EMEA. LEARNING OBJECTIVES In this chapter you will learn about: – –Shadow rendering algorithms – –Blinn’s shadow.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Shadows (2) ©Anthony Steed Overview n Shadows – Umbra Recap n Penumbra Analytical v. Sampling n Analytical Aspect graphs Discontinuity meshing.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Shadows. Shadows is important in scenes, consolidating spatial relationships “Geometric shadows”: the shape of an area in shadow Early days, just pasted.
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.
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
Hardware-accelerated Rendering of Antialiased Shadows With Shadow Maps Stefan Brabec and Hans-Peter Seidel Max-Planck-Institut für Informatik Saarbrücken,
Sample Based Visibility for Soft Shadows using Alias-free Shadow Maps Erik Sintorn – Ulf Assarsson – uffe.
Computer graphics & visualization Shadows / Transparency.
Visual Appearance Chapter 4 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Soft Shadow Volumes for Ray Tracing
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.
Graphics, Modeling, and Textures Computer Game Design and Development.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Shadows & occlusion  Shadow - occlusion duality  Floor shadows.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Shuen-Huei Guan Seminar in CMLab, NTU
CENG 477 Introduction to Computer Graphics
- Introduction - Graphics Pipeline
Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world.
Real-Time Soft Shadows with Adaptive Light Source Sampling
A Geometry-Based Soft Shadow Volume Algorithm Using Graphics Hardware
Graphics Processing Unit
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Jim X. Chen George Mason University
Graphics, Modeling, and Textures
Real-time Rendering Shadow Maps
UMBC Graphics for Games
A Hierarchical Shadow Volume Algorithm
Presentation transcript:

A Real-Time Soft Shadow Volume Algorithm DTU Vision days Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Sweden

Copyright 2003 Tomas Akenine-Möller 2 Shadow Generation Why? In computer graphics, shadows are not generated automatically Must create algorithms for this! Shadows help with: –Realism –Atmosphere –Spatial relationships

Copyright 2003 Tomas Akenine-Möller 3 Spatial relationships

Copyright 2003 Tomas Akenine-Möller 4 Other classical images on the need for shadows Images courtesy of Micheal McCool, University of Waterloo

Copyright 2003 Tomas Akenine-Möller 5 Hard vs soft shadows Two different light source types point source umbra area source umbrapenumbra

Copyright 2003 Tomas Akenine-Möller 6 Example: hard vs soft Point light source Area light source umbra penumbra umbra

Copyright 2003 Tomas Akenine-Möller 7 Ways of thinking about shadows As separate objects (like Peter Pan's shadow) As volumes of space that are dark As places not seen from a light source looking at the scene We base our work on Crow’s shadow volume algorithm (option 2 above) from 1977

Copyright 2003 Tomas Akenine-Möller 8 Shadow mapping Shadow mapping is used in Pixar’s rendering SW, but also in real time using graphics hardware Render from light’s view (white is far and black is near) Use pixel shader to determine if point is in shadow Use percentage-closer filtering for better quality Pros and cons: –BAD: Discrete representation –BAD: Incorrect self-shadowing –BAD: frustum limited –GOOD: can reuse SM if geometry & light static –GOOD: can use any shadow casters and receivers

Copyright 2003 Tomas Akenine-Möller 9 (Hard) Shadow volumes Very popular method for real time Shadow volume concept Create volumes of space in shadow from each polygon in light. Each triangle creates 3 projecting quads

Copyright 2003 Tomas Akenine-Möller 10 Using the Shadow Volume To test a point, count the number of polygons between it and the eye. If we look through more frontfacing than backfacing polygons, then in shadow. frontfacing backfacing

Copyright 2003 Tomas Akenine-Möller 11 Soft shadow algorithms in general Fundamental problem in computer graphics Inherently difficult!

Copyright 2003 Tomas Akenine-Möller 12 A Real-Time Soft Shadow Volume Algorithm Insight Given that there is geometry inside a wedge, how can we compute the light contribution accurately?

Copyright 2003 Tomas Akenine-Möller 13 Visibility computation Really want to compute how much we can see of the light source

Copyright 2003 Tomas Akenine-Möller 14 Precomputed coverage in 4D textures

Copyright 2003 Tomas Akenine-Möller 15 4D textures used as look-up table Enables –Fast computation –Textured light sources (e.g., fire) Texturing is normally very fast on today’s graphics hardware because of: –Texture caches –Intelligent prefetching

Copyright 2003 Tomas Akenine-Möller 16 More examples using textured lights

Copyright 2003 Tomas Akenine-Möller 17 The Soft Shadow Volume Algorithm 1st pass: Render hard shadow quads (as usual) –To be sure that we register when we enter/exit umbra 2nd pass: compensate for overstated umbra

Copyright 2003 Tomas Akenine-Möller 18 Example of how it works

Copyright 2003 Tomas Akenine-Möller 19 Some details on our hardware implementation… Performance was poor when we finally got a higly programmable graphics card –SW rendering > HW rendering! Had to fine tune the implementation: –Tighter wedges for rectangular lights –Optimized pixel shaders –Frame buffer blending –Culling

Copyright 2003 Tomas Akenine-Möller 20 Optimized pixel shaders Have implemented both spherical and rectangular light sources Rectangular case: –Create frustum from point-to-be-shaded, p, to light, and clip edge to frustum –Transform so that p is in (0,0,0) and normal of light parallel to z-axis –Use projection matrix to transform to clip- space –Clip in homogeneous space, divide by w –Use 4D texture of clipped endpoints Shaders are about 60 instructions long

Copyright 2003 Tomas Akenine-Möller 21 Reserved for overflow Frame buffer blending Need: add and subtract hires-values to V-buffer –Need >8 bits if you want 256 shadow levels –Not available on Radeon 9700 or GeForce FX! Solution: split value across 8-bit components Use 5 bits of overflow: allows 32 overlapping wedges One byte Bit 3 Bit 4 Bit 5 Gives a 12-bit coverage value using 4 bytes To create final value using LUT: –8*XXXXX543+XXXX210=YYYYY Two rendering passes: one for additive and one for subtractive values

Copyright 2003 Tomas Akenine-Möller 22 Shadow receiver wedge Pixel shader culling PS only change V-buffer if (x,y,z) is inside wedge  cull everything else! Culling: –Frontfacing (FF) tris of wedge rendered into stencil buffer if tris in front of rendered geometry –Render BF tris where stencil is one, and tris are farther away than rendered geometry –Execute pixel shader that passes these tests FF BF

Copyright 2003 Tomas Akenine-Möller 23 Results Optimizations for graphics hardware: –Gives real-time performance –This is the only existing algorithm with this kind of performance, and with high quality (no sampling artifacts) –At least as far as we know… Video

Copyright 2003 Tomas Akenine-Möller 24 Two artifacts! Overlapping geometry is handled incorrectly Single silhouette error

Copyright 2003 Tomas Akenine-Möller 25 For better quality, use 2x2 area lights… (and 2x2 does not cost 4 times as much!)

Copyright 2003 Tomas Akenine-Möller 26 On Shadow Volume Silhouettes (SVS) We use silhouette edges as seen from light Many people believe that a SVS vertex is connected to two edges We prove that SVS vertices can be connected to any even number of edges

Copyright 2003 Tomas Akenine-Möller 27 Our soft shadow contributions Work done with Ulf Assarsson (soon PhD!) Publications: –Tomas Akenine-Möller and Ulf Assarsson, “Rapid Soft Shadows on Arbitrary Surfaces using Penumbra Wedges,” Eurographics Workshop on Rendering 2002, pp , June –Ulf Assarsson and Tomas Akenine-Möller, “Optimized and Generalized Real-Time Soft Shadows using Penumbra Wedges,” to appear in The Visual Computer, –Ulf Assarsson and Tomas Akenine-Möller, “A Geometry-based Soft Shadow Volume Algorithm using Graphics Hardware,” to appear in SIGGRAPH 2003, July –Ulf Assarsson, Michael Dougherty, Michael Mounier, and Tomas Akenine- Möller, “An Optimized Soft Shadow Volume Algorithm with Real-Time Performance,” to appear in Graphics Hardware –Tomas Akenine-Möller and Ulf Assarsson, “On Shadow Volume Silhouettes,” submitted to journal of graphics tools, April 2003.

Thanks for listening… Over to real-time soft shadow demo… 1024 hard shadow samplesOur algorithm