Global Illumination. CS7GV3 Real-time Rendering

Similar documents
Photorealism: Ray Tracing

The Rendering Equation and Path Tracing

Illumination Algorithms

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

MIT Monte-Carlo Ray Tracing. MIT EECS 6.837, Cutler and Durand 1

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

COMP371 COMPUTER GRAPHICS

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

A Brief Overview of. Global Illumination. Thomas Larsson, Afshin Ameri Mälardalen University

Raytracing & Epsilon. Today. Last Time? Forward Ray Tracing. Does Ray Tracing Simulate Physics? Local Illumination

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

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

Lecture 10: Ray tracing

Computer Graphics. - Ray Tracing I - Marcus Magnor Philipp Slusallek. Computer Graphics WS05/06 Ray Tracing I

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

CS 428: Fall Introduction to. Raytracing. Andrew Nealen, Rutgers, /18/2009 1

11/2/2010. In the last lecture. Monte-Carlo Ray Tracing : Path Tracing. Today. Shadow ray towards the light at each vertex. Path Tracing : algorithm

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

Ray Tracing. Kjetil Babington

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

Advanced Graphics. Path Tracing and Photon Mapping Part 2. Path Tracing and Photon Mapping

Distribution Ray Tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

Rendering Part I (Basics & Ray tracing) Lecture 25 December 1, 2015

03 RENDERING PART TWO

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

Reflection and Shading

Computer Graphics. - Introduction to Ray Tracing - Philipp Slusallek

The Rendering Equation & Monte Carlo Ray Tracing

Schedule. MIT Monte-Carlo Ray Tracing. Radiosity. Review of last week? Limitations of radiosity. Radiosity

Monte Carlo Ray-tracing and Rendering

Global Illumination. COMP 575/770 Spring 2013

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

Reading. 8. Distribution Ray Tracing. Required: Watt, sections 10.6,14.8. Further reading:

Advanced Graphics. Global Illumination. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

NVIDIA Case Studies:

Physically Realistic Ray Tracing

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

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

Supplement to Lecture 16

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

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

Sung-Eui Yoon ( 윤성의 )

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

Photon Mapping. Michael Doggett Department of Computer Science Lund university

RAYTRACING. Christopher Peters INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION. HPCViz, KTH Royal Institute of Technology, Sweden

CS 325 Computer Graphics

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

Global Illumination The Game of Light Transport. Jian Huang

Final Project: Real-Time Global Illumination with Radiance Regression Functions

CPSC GLOBAL ILLUMINATION

Lighting and Shading

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

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

Computer Graphics. Ray Tracing. Based on slides by Dianna Xu, Bryn Mawr College

Global Illumination. Why Global Illumination. Pros/Cons and Applications. What s Global Illumination

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

EDAN30 Photorealistic Computer Graphics. Ray tracing. Michael Doggett Department of Computer Science Lund university. Copyright 2011 Michael Doggett

Recent Advances in Monte Carlo Offline Rendering

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

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

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

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

The V-Ray installer will automatically remove any previous installations. This will allow you to seamlessly upgrade from previous versions.

Simple Nested Dielectrics in Ray Traced Images

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

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2

The Rendering Equation. Computer Graphics CMU /15-662, Fall 2016

Path Tracing part 2. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

CS635 Spring Department of Computer Science Purdue University

Stochastic Path Tracing and Image-based lighting

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

CS 488. More Shading and Illumination. Luc RENAMBOT

MIT Ray Tracing Ray Tracing

Raytracing CS148 AS3. Due :59pm PDT

Geometric optics. The University of Texas at Austin CS384G Computer Graphics Don Fussell

Distribution Ray Tracing

The Rendering Equation. Computer Graphics CMU /15-662

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

Lecture 17: Recursive Ray Tracing. Where is the way where light dwelleth? Job 38:19

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies" Ø The Hall illumination model. Ø Original ray tracing paper

Intro to Ray-Tracing & Ray-Surface Acceleration

Ray Tracing. Local Illumination. Object Space: Global Illumination. Image Space: Backward Ray Tracing. First idea: Forward Ray Tracing

Reading. Distribution Ray Tracing. BRDF, revisited. Pixel anti-aliasing. ω in. Required: Shirley, section Further reading:

COMPUTER GRAPHICS AND INTERACTION

Indirect Illumination

Local vs. Global Illumination & Radiosity

Ray-Tracing. Misha Kazhdan

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

Raytracing. COSC 4328/5327 Scott A. King

Ray Tracing. Brian Curless CSEP 557 Fall 2016

Introduction to Visualization and Computer Graphics

Ray Tracing: Special Topics CSCI 4239/5239 Advanced Computer Graphics Spring 2018

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

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

A Little Background. Motivation. Motivation

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

Chapter 7 - Light, Materials, Appearance

COMPUTER GRAPHICS COURSE. Ray Tracing

Transcription:

Global Illumination CS7GV3 Real-time Rendering

Photorealism Profil by Jaques Bodin. Photorealism artists exploit high detail, depth of field, wide angle, lighting, and focus anomalies

Richard Estes, Supermarket, Columbus Avenue, NY, 2008

Ray traced rendering in POV-Ray Gilles Tran

Global Illumination

The Rendering Equation Kajiya s [1986] representation of light transport in the scene, describing the amount of light going from any point x to another point x : I( x, x') = g( x, x')[ ε ( x, x') + ρ ( x, x', I(x, x ) = intensity of light passing from x to x (two point transport) g(x, x ) = (geometry factor) e (x, x ) = intensity of light emitted by x and passing to x r (x, x, x ) = bi-directional reflectance scaling factor for light passing from x to x by reflecting off x S = all surfaces in the scene 0 if x and x are not mutually visible 1/r 2 where r = xx' s x") I( x', x") dx"] Attenuation (distance from x to x ) p (x, x, x ) = is related to the intensity of light scatted from x to x by a patch of surface x James T. Kajiya. 1986. The rendering equation. In Proceedings of the 13th annual conference on Computer graphics and interactive techniques (SIGGRAPH '86), David C. Evans and Russell J. Athay (Eds.). ACM, New York, NY, USA, 143-150. DOI=http://dx.doi.org/10.1145/15922.15902

Recursive Light Transport Light_transport_from B to A depends on: Emmitance of B Visibility of B from A Distance to B from A A B Also: Reflectance of B Light transport from C i to B Emmitance of C Visibility of C from B Distance to C from B D 1 C 2 C 1 C 3

Ray-tracing

Perspective Man Drawing a Lute Albrecht Durer (1471-1528)

Ray Tracing A recursive view-dependent rendering algorithm Photo-realistic technique Current ray tracing methods are attributed to Turner Whitted First implementation of ray tracing in computer graphics = Appel (IBM 1968) Took 74 minutes to render this image Turner Whitted. 1980. An improved illumination model for shaded display. Commun. ACM 23, 6 (June 1980), 343-349. DOI=http://dx.doi.org/10.1145/358876.358882

Ray Tracing I = I local + k rg I + k tg I Local term (as in Phong) Reflected Transmitted The Direct Diffuse Term I local is calculated empirically (using Phong illumination) In the global ray-traced terms, diffusion of light due to surface imperfections is totally ignored.

Ray Tracing from Eye Tracing from light source Traditional ray-tracing Starting at the light position traces many rays that never reach the eye. Thus the traditional ray-tracing method is to start at the eye and trace rays back-wards to the source.

Eye Ray and Object Intersection Cast a ray from camera position through each pixel into the scene. Calculate where this intersects with objects in the scene. Get the first intersection.

Shadow Rays Extend a Shadow Feeler (or light ray) and see if it is occluded by an object in the scene If so the object is in shadow from this light source (no contribution at this point) Otherwise solve the Phong model to calculate the contribution of this point to the colour of the pixel. If object is diffuse stop here.

Reflection If object is specular THEN create a ray in the direction of perfect specular reflection. For this new ray, we will again check whether it intersects an object, if so is this object in shadow what is the contribution of this object to the colour of the pixel? Each ray contributes to the colour of the pixel it originated from

Refraction Similarly if the object is transmissive (not-opaque) then generate a transmitted (or refracted) ray and repeat

The Angle of Refraction When light passes from a material of one optical density to another it changes direction. The amount by which the direction changes is determined by the optical densities of the two media. θ i = 45 θi = 45 = 45 θ i Air Water θ = 32 θ = 28 θ r = 17 r Air Glass r Air Diamond Optical density (and thus the amount of bending is related to a value we call the index of refraction (ior) of the material

Index of Refraction (ior) Material Index of Refraction Vacuum 1.0000 <--lowest optical density Air 1.0003 Ice 1.31 Water 1.333 Ethyl Alcohol 1.36 Plexiglas 1.51 Crown Glass 1.52 Light Flint Glass 1.58 Dense Flint Glass 1.66 Zircon 1.923 Diamond 2.417 Rutile 2.907 Gallium phosphide 3.50 <--highest optical density

Ray Tracing Summary

Ray Tracing Algorithm 1) Cast a ray I = I local + k rg I + k tg I 2) Determine Intersections 3) For closest Intersection: Extend light(shadow feeler) ray + calculate local term Spawn Transmitted Ray (step 1) Spawn Reflected Ray (step 1)

The Ray Tracing Algorithm Recursion for each pixel in viewport { determine eye ray for pixel intersection = trace(ray, objects) colour = shade(ray, intersection) } Intersection trace(ray, objects) { for each object in scene intersect(ray, object) sort intersections return closest intersection } Colour shade(ray, Intersection) { for each light in scene col += Phong(trace(ray, light)) col += shade(trace(ray, refl)) col += shade(trace(ray, refr)) return col; }

Ray Tree The spawning of reflected and refracted rays can be represented in tree structure.

Terminating Recursion All of the spawned rays contribute to the pixel that the tree originated from. However each new ray contributes less and less to the pixel. Unlike in the real-world, we can t keep bouncing around for ever so we stop the recursion at some stage recursion clipping. Stop after a set number of bounces. Or stop when the contribution becomes less than a certain value.

Recursion Clipping max level = 1 max level = 2 Very high maximum recursion level max level = 3 max level = 4

Terminating Recursion for each pixel in viewport { determine eye ray for pixel intersection = trace(ray, objects) colour = shade(ray, intersection) } trace(ray, objects) { for each object in scene intersect(ray, object) sort intersections return closest intersection } colour shade(ray, intersection) { if no intersection return background colour for each light source if(visible) colour += Phong contribution if(recursion level < maxlevel and surface not diffuse) { ray = reflected ray intersection = trace(ray, objects) colour += ρ refl *shade(ray, intersection) ray = transmitted ray intersection = trace(ray, objects) colour += ρ trans * shade(ray, intersection) } return colour }

The Ray A ray is mathematically the affine half-space defined by: r = O + td t 0 All points on the ray correspond to some positive value of t, the parametric distance along the ray. If d is normalised then t is the length along the ray of the point.

Ray Casting Assuming a pinhole camera model, a view is specified using: camera view E L U (θ, φ) d eye/camera position look point (defined gaze direction) up vector (fixes orientation) horizontal and vertical field of view angles distance to viewing plane from eye point From this calculate the camera coordinate system:

Eye Ray Construction We need to construct rays originating at the eye and passing through a point on the viewport. We need to relate the viewport and window co-ordinate systems. Construct vectors u and v which span the viewing plane Determine origin of viewport (usually defined as the center) all points P on the viewport are linear combinations of u and v with scalars α and β defining the co-ordinate of the point: P = αu + βv

Eye Ray Construction We need to construct rays originating at the eye and passing through points P i on the viewport. α = viewport ( x + 0 5) 2( y + 0 5) 2 1 β = 1 x res y res window Pixel center used for ray direction. Y value is inverted

Super Sampling Schemes One ray per pixel is usually not sufficient Send n rays per pixel and filter the result (usually take a weighted average): Regular Samples distributed uniformly within the pixel Super Sampling Adaptive Sample more in regions with high colour gradients Stochastic Random Stratified Sample randomly within the pixel Sample randomly within sub-pixel intervals

Super Sampling Regular Random Stratified Samples/Pixel 1 4 16

Object Intersection Intersection testing is solved mathematically. But is an inherently expensive geometrical problem. 90% of computation time. Where does ray intersect object? Where does ray intersect scene?

Acceleration Strategies

A hardware unit for fast SAH-optimised BVH construction Specialised microarchitecture Construction of binned SAH BVHs Michael J. Doyle, Colin Fowler, and Michael Manzke. 2013. A hardware unit for fast SAH-optimised BVH construction. ACM Trans. Graph. 32, 4, Article 139 (July 2013), 10 pages. DOI: https://doi.org/10.1145/2461912.2462025

Ray-tracing Limitations Some global effects not fully possible Correct shadows & caustics of refractive objects Indirect illumination from reflective objects Diffuse global reflection colour bleeding Slow (well we get better at it)

Realtime Ray-tracing Advantages: Scales well on multi-core Accurate shadows Pixel accurate reflection, refraction Simple portals Scales logarithmically with geometry complexity Trivial instancing Photo-realism is a solved problem largely using ray tracing

Recent Advances Embree ray tracing kernels: overview and new features Attila T. Áfra, Ingo Wald, Carsten Benthin, and Sven Woop. 2016. Embree ray tracing kernels: overview and new features. In ACM SIGGRAPH 2016 Talks (SIGGRAPH '16). ACM, New York, NY, USA, Article 52, 2 pages. DOI: https://doi.org/10.1145/2897839.2927450 OptiX: a general purpose ray tracing engine Steven G. Parker, James Bigler, Andreas Dietrich, Heiko Friedrich, Jared Hoberock, David Luebke, David McAllister, Morgan McGuire, Keith Morley, Austin Robison, and Martin Stich. 2010. OptiX: a general purpose ray tracing engine. In ACM SIGGRAPH 2010 papers (SIGGRAPH '10), Hugues Hoppe (Ed.). ACM, New York, NY, USA, Article 66, 13 pages. DOI: https://doi.org/10.1145/1833349.1778803

Radiosity Radiance transfer modelled on patches of the scene (finite element discretization of the scene) Illumination calculated recursively based transfer of radiant energy between patches Assumption of diffuse light-material interaction

Progressive Radiosity

Radiosity Provides soft shadows, color bleeding and indirect illumination for free; However, does not handle specular reflection, has difficulty in processing transparency (i.e., reflection and refraction), requires the scene to be subdivided a second pass (e.g., ray tracing) is needed to produce reflection and refraction. is very time consuming. View independent useful for pre-process

Photon Mapping Two-pass global illumination technique [Jensen 96] 1. Use photons to simulate transport of individual photon energy. Pre-trace from lights to build the Photon Map N.B. Photon Map is not an image 2. Trace paths from viewer to see where this is picked up

Photon Mapping Accounts for color bleeding, soft shadows, indirect illumination, scattering by participating media caustic effects Works with arbitrary geometry Low memory consumption Correct rendering results (although can introduce noise)

First Pass

First Pass

First Pass

Second Pass

Second Pass

Second Pass

Photon Mapping Refs Jensen s PhD published as a book: Jensen, Henrik W., Realistic Image Synthesis Using Photon Mapping, A K Peters, Ltd., Massachusetts, 2001 Seminal Paper: Jensen, Henrik W., Global Illumination using Photon Maps, in Rendering Techniques 1996 (7 th Eurographics Symposium on Rendering) http://sites.fas.harvard.edu/~cs278/papers/pmap.pdf A summaryby Zack Waters: http://web.cs.wpi.edu/~emmanuel/courses/cs563/write_ups/zackw/ photon_mapping/photonmapping.html Online Interactive applet with code comparing ray-tracing and photon mapping by Grant Schindler http://www.cc.gatech.edu/~phlosoft/photon/