Fast Calculation of Soft Shadow Textures Using Convolution

Similar documents
CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

03 RENDERING PART TWO

Shadows in the graphics pipeline

Computer Graphics. Shadows

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Computer Graphics 10 - Shadows

Computergrafik. Matthias Zwicker. Herbst 2010

CPSC GLOBAL ILLUMINATION

Advanced Shading I: Shadow Rasterization Techniques

Soft Shadows: Heckbert & Herf. Soft shadows. Heckbert & Herf Soft Shadows. Cornell University CS 569: Interactive Computer Graphics.

Graphics for VEs. Ruth Aylett

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Local vs. Global Illumination & Radiosity

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

Visibility. Tom Funkhouser COS 526, Fall Slides mostly by Frédo Durand

Shadow Algorithms. CSE 781 Winter Han-Wei Shen

Illumination and Geometry Techniques. Karljohan Lundin Palmerius

Shadows. COMP 575/770 Spring 2013

Sung-Eui Yoon ( 윤성의 )

CHAPTER 1 Graphics Systems and Models 3

Lecture 15: Shading-I. CITS3003 Graphics & Animation

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Real-Time Shadows. André Offringa Timo Laman

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline

Rasterization Overview

Level of Details in Computer Rendering

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity

Bringing Hollywood to Real Time. Abe Wiley 3D Artist 3-D Application Research Group

Graphics for VEs. Ruth Aylett

The Rendering Equation & Monte Carlo Ray Tracing

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Pipeline Operations. CS 4620 Lecture 10

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Global Illumination The Game of Light Transport. Jian Huang

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Real-Time Shadows. Last Time? Textures can Alias. Schedule. Questions? Quiz 1: Tuesday October 26 th, in class (1 week from today!

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Photorealism: Ray Tracing

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Introduction to Visualization and Computer Graphics

Graphics and Interaction Rendering pipeline & object modelling

Real-Time Shadows. MIT EECS 6.837, Durand and Cutler

Photorealism vs. Non-Photorealism in Computer Graphics

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

Chapter 7 - Light, Materials, Appearance

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

Models and Architectures

Global Illumination. CSCI 420 Computer Graphics Lecture 18. BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

lecture 18 - ray tracing - environment mapping - refraction

Thesis Report. Thesis Title: Soft Shadow Rendering in Real Time. Shihab Rezwan Manzur ID: CSE Department BRAC University

COMP371 COMPUTER GRAPHICS

A Frequency Analysis of Light Transport

Real-Time Shadows. Last Time? Schedule. Questions? Today. Why are Shadows Important?

Computer Graphics. - Texturing Methods -

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

The Traditional Graphics Pipeline

Real-Time Shadows. Last Time? Today. Why are Shadows Important? Shadows as a Depth Cue. For Intuition about Scene Lighting

Computer Graphics Global Illumination

Creating soft shadows

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Acknowledgement: Images and many slides from presentations by Mark J. Kilgard and other Nvidia folks, from slides on developer.nvidia.

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Pipeline Operations. CS 4620 Lecture 14

Global Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Computer Graphics I Lecture 11

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

CS5620 Intro to Computer Graphics

Computer Graphics Global Illumination

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

The Traditional Graphics Pipeline

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Fog and Cloud Effects. Karl Smeltzer Alice Cao John Comstock

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Shadows. Real-Time Hard Shadows. Collected by Ronen Gvili. Most slides were taken from : Fredu Durand Stefan Brabec

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

What for? Shadows tell us about the relative locations. Vienna University of Technology 2

Shadow Rendering EDA101 Advanced Shading and Rendering

Virtual Reality for Human Computer Interaction

Hidden Surface Elimination Raytracing. Pre-lecture business. Outline for today. Review Quiz. Image-Space vs. Object-Space

The Animation Process. Lighting: Illusions of Illumination

Stencil Shadow Volumes

Shading, Advanced Rendering. Week 7, Wed Feb 28

Overview: Ray Tracing & The Perspective Projection Pipeline

Transcription:

Using Fast Calculation of Soft Shadow Textures Using Convolution Cyril Soler and Francois X. Sillion To Implement Real Time Shadows for Interactive Applications Adam Moravanszky Presentation GDV-Seminar Summer 2000 Overview The Problem and Terminology Shadows in Computer Graphics Theory Shadows in Practice Shadows in this Paper Demo of Implementation 1

What are Shadows? Definitions Light source Blocker Receiver Umbra - completely occluded (all illumination from other sources) Penumbra - partially occluded Shadows in Computer Graphics Theory No Shadows Raytraced Shadow Buffers Shadow Volumes Radiosity Shadow Textures These are all raster/image/texture based algos like that of current paper, but still represent a broad overview. The total number of shadow algos available is much greater! Shadowing is a form of hidden surface determination problem, so shadow algos have much in common with HSD algos for cameras. 2

Shadows in Computer Graphics Theory: No Shadows Vertex Lighting ( OpenGL) Shadows in Computer Graphics Theory: Raytraced Trace ray from eye through pixel, stabbing object. See if light is visible from rayobject intersection point. (Other objects may be in the way) Improvement: Light Buffers For each light s each discretized solid angle, record all the polygons visible in this direction, and sort according to depth. Above visibility computation becomes table lookup. NB: Incompatible with grx. hw. 3

Shadows in Computer Graphics Theory: Shadow Buffers Two z buffers: one from viewer POV, other from lightsource. 1) Create z buffer from light POV. 2) when a fragment is determined to be visible via viewer z-buffer, it s coordinates are transformed into the light s coord sys. 3) These coordinates are looked up in the light s z buffer. If the value stored there is closer than the actual distance, the fragment is in shadow, else it is illuminated. NB: Suitable for eventual hardware implementation, but this level of the graphics pipeline is no longer in the application programmer s hands. Shadows in Computer Graphics Theory: Shadow Volumes Create a shadow volume for each blocker+light source. Shadow volume is space occluded by silouette of blocker, delimited by shadow polygons. A point is in shadow if the line segment from the viewer (assumed to be out of shadow) to the point intersects an odd number of shadow polygons. (like 2D in polygon test) Potentially practical for real time apps. More later. 4

Shadows in Computer Graphics Theory: Radiosity Adaptive subdivision via quadtree produces stair-step effect. View independent global illumination algorithm. (Can be done off-line!) Lighting model evaluated recursively at regular intervals on surfaces in scene. Color determined by light absorbed from all other surfaces. Implicit soft shadows, crispness depends on sampling density. Only diffuse lighting taken into account (specular is view dependent) so only some surface types can be simulated accurately unless combined with other techniques. Interesting for real time simulation, more later. Shadows in Computer Graphics Theory: Radiosity with Discontinuity Meshing Choose radiosity evaluation mesh according to lighting conditions rather than recursive arbitrary orthogonal subdivision scheme as before. 5

Shadows in Computer Graphics Theory: Shadow Textures First used for real time display of results of Radiosity algorithm / shadows. Texture mapping is often implemented in hardware. Shadow texture maps are,like Radiosity, view independent, and don t have to be recomputed if only the POV changes. Soft shadows can be supported by sampling the area light a few times and superimposing the texture images. (Paul Heckbert, 1995) Foundation of the current paper. No Shadows Circular Splotches Projected Geometry Stencil Shadows Lightmaps Shadows in Practice 6

Shadows in Practice No Shadows Pros: Guaranteed Faster than any other algorithm. May look better than hard shadows Cons: Difficult to judge depth of objects. Hovering effect. Rogue Spear Shadows in Practice Circular Splotches Pros: Fast Gives a minimal sense of depth. Cons: Not very realistic at all. Duke QuakeNukem III Arena Forever 7

Shadows in Practice Projected Geometry Most popular technique today. Pros: Shadow of approximately correct shape Fast Kingpin Shadows in Practice Projected Geometry [BLIN88] Usually paralell projection so shadow doesn t grow to minimize ugly effects. Quake III Arena Cons: Hard shadow Receiver is assumed to be a single plane Usually not clipped at ledges Performance is function of blocker mesh complexity - usually low LOD mesh used. 8

Shadows in Practice Stencil Buffers? Much talk about it, but no succesful commercial implementation found. Pros: Perfect shape even on arbitrary geometry. Cons: Hard shadow Lacking stencil buffer support Needs second pass -> Image buffer res. dependant Shadows in Practice Lightmap textures Pros: Computed off-line - w. radiosity (Free!) Soft shadow Cons: Storage intensive Usu. low resolution Only for static geometry Quake III Arena (uniform sampling mesh) 9

Shadows in Practice PowerPoint Soft Shadow Textures Using Convolution Features: Compatible with any graphics pipeline which supports textures. Takes volume lights into account. Soft shadows. Object based. Produces approximately correct results. Based on projected textures tech. 10

Simple Paralell Configuration Basic problem: How to generate blurry shadow image which takes shape and distance of light source into account? First, a simple assumption of the configuration of the scene: Simple paralell configuration Math Foundations for Paralell Scheme Our math. foundation for correct shading is our definition of Irradiance H(x)- the total radiation arriving at a point y on a surface. H(y) = L i (y, θ,φ) dθdφ - integral of radiance coming in from all directions. 11

Separating Formula Into Two Pieces For one light source with directionally invariant exitance E this becomes: H(y) = (E/π) cos θ cos θ d -2 v(x,y) dx Approximation / Fudging as usual: H(y) E cos θ cos θ π -1 d -2 dx E v(x,y) dx F(y) E V(y) Form factor Visible area of the source H(y) F(y) E V(y) x - point on source, d - distance(x,y) θθ - ray angles on s&r. Computing E, F and V E*F is unoccluded illumination term, can be computed with Radiosity, or direct illumination formulas (OpenGL). V can be computed as integral of projection of blocker on source as y moves on the receiver. It can be shown that this is a convolution operation on the source and blocker image. (next slide!) E can be taken inside the integral. Practically this means that we may modulate the source image by it s exitance function (textured light!) before doing the convolution. The product of F and (EV) can be executed as a (hardware) texture blending operation. 12

Proof that Convolution is Appropriate Intuitively: A spherical light source will act as a regular lowpass filter and blur the blocker image uniformly - and produce even penumbras. An cylindric flour. light s image will blur primarily along its length s direction, which is the type of shadow it produces. Math: see paper for derivation. Resulting formula: a := d 1 /d 2 ---> scale factor for textures. binary f-s (textures): S(x) = 1 if x on source. P(x) = 0 if x on blocker V(y)= a -2 ( S(-a -1 x ) * P((1+a) -1 x))(y) Btw: (discrete) 2D convolution * is: V[u][v] = Σ j Σ i S [u + i][v + j] P[ i ][ j ] General Configuration Before we assumed that all geometry was paralell planar. Now we transform the actual arbitrary geometry to such an ideal configuration: choose a projection direction D. choose the three planes for source, blocker and receiver orthogonal to D. 13

Transforming into Paralell Configuration The Projection direction D is chosen to be a good representative of all rays from the source to the receiver --> come up with an approximate frustum using the bounding volume of the receiver, then take the direction of the frustum for D. The altitudes of the orthogonal planes on D are effectively the assumed distances between the objects. Choose them so the centers of the altitude ranges of the objects. Can choose blocker plane altitude so that we end up with in avg. correctly sized penumbras based on penumbra error metric (later). Rendering Images When two images have been rendered, convolve them either directly, or better, with FFTs by using the property: f*g(y) = FT -1 (FT(f)FT(g)) When using FFTs, we have to enlarge the frustra a little to protect from wrap around which comes from FT assuming that the images are periodic. 14

Problems and Sources of Error Assuming that geometry can easily be separated into blocker and receiver may be a serious restriction. As entire blocker is projected into a single plane, no chance for gradual loss of shadow focus for long objects. All penumbra regions of an object will have same sharpness. Texture resolution is a variable. Measuring the Error We have math to back up virtual paralell scheme so that is OK. What is error of projecting geometry into the planes? Paper presents a way to estimate human perceived rather than actual error (compare lum. functions), looking at only rendered vs. correct penumbra sizes as this is most obvious error. Computation compares penumbra size computed using virtual plane altitudes vs. hypothetical vertex altitudes = error variable. 15

Soft Shadow Textures Using Convolution Reducing the error: Source Subdivision Blocker Subdivision combining shadow textures from different blocker clusters is not trivial. Receiver Subdivision separate shadow textures computed for each piece. boundary artifacts where textures meet. Shadow texture resolution Hierarchical refinement. Soft Shadow Textures Using Convolution My opinion: Can be done very well in real time. FFT is surprisingly fast. Best for indoor character shadows where object based system is not a problem, and we expect nice penumbras. Small inaccuracies in penumbra size not noticed by casual observer. Best looking real time shadows yet. Good use of HW multitexture capability. Readback from rendertarget is not optimized. Rendering the textures eventually a bottle neck. This may change soon. Not too difficult to implement. Bottom line: Best algo for this purpose at this time! 16

Soft Shadow Textures Using Convolution Their implementation: Part of off-line Radiosity Renderer. Soft Shadow Textures Using Convolution My implementation: Attempt at using variations of this technique for real time shadows in a game-like environment. Visualization for technique. OpenGL vertex lighting on original geometry (no subdivision for lighting). Source images pre-rendered. Not done yet. Not at all optimzied. Works at interactive framerates on newer hardware accelerated PCs. 17