Physically-Based Rendering

Slides:



Advertisements
Similar presentations
Physically Based Shading
Advertisements

William A.P. Smith and Edwin R. Hancock Department of Computer Science, University of York, UK CVPR 2009 Reporter: Annie Lin.
Computer Vision Radiometry. Bahadir K. Gunturk2 Radiometry Radiometry is the part of image formation concerned with the relation among the amounts of.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Computer graphics & visualization Global Illumination Effects.
Environment Mapping CSE 781 – Roger Crawfis
Local Reflection Model Jian Huang, CS 594, Fall 2002.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 21: Radiometry Many slides courtesy Pat Hanrahan.
Radiometry. Outline What is Radiometry? Quantities Radiant energy, flux density Irradiance, Radiance Spherical coordinates, foreshortening Modeling surface.
Physically Based Illumination Models
Advanced Computer Graphics (Spring 2013) CS 283, Lecture 8: Illumination and Reflection Many slides courtesy.
Torrance Sparrow Model of Reflectance + Oren Nayar Model of Reflectance.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Lighting/Shading II Week.
University of Texas at Austin CS395T - Advanced Image Synthesis Spring 2006 Don Fussell Previous lecture Reflectance I BRDF, BTDF, BSDF Ideal specular.
CSCE 641: Photon Mapping Jinxiang Chai. Outline Rendering equation Photon mapping.
Photon Tracing with Arbitrary Materials Patrick Yau.
Computer Graphics (Spring 2008) COMS 4160, Lecture 20: Illumination and Shading 2
6.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 6 Physically Based Reflection Model.
Computer Graphics (Fall 2008) COMS 4160, Lecture 19: Illumination and Shading 2
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Introduction to Computer Vision CS / ECE 181B Tues, May 18, 2004 Ack: Matthew Turk (slides)
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
7M836 Animation & Rendering
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Lighting and Shading Week.
Computer Graphics (Fall 2004) COMS 4160, Lecture 16: Illumination and Shading 2 Lecture includes number of slides from.
Lighting affects appearance. Light Source emits photons Photons travel in a straight line When they hit an object they: bounce off in a new direction.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Specular Reflections from Rough Surfaces Lecture #4 Thanks to Shree Nayar, Ravi Ramamoorthi, Pat Hanrahan.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
CS 445 / 645: Introductory Computer Graphics
-Global Illumination Techniques
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
David Luebke 1 10/26/2015 Lighting CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
CSE 381 – Advanced Game Programming GLSL Lighting.
Advanced Illumination Models Chapter 7 of “Real-Time Rendering, 3 rd Edition”
Diffuse Reflections from Rough Surfaces Lecture #5
Announcements Office hours today 2:30-3:30 Graded midterms will be returned at the end of the class.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Material Representation K. H. Ko School of Mechatronics Gwangju Institute.
CSCE 641 Computer Graphics: Reflection Models Jinxiang Chai.
BRDF models and their use in Global Illumination Algorithms László Szirmay-Kalos.
Computer Graphics (Spring 2003) COMS 4160, Lecture 18: Shading 2 Ravi Ramamoorthi Guest Lecturer: Aner Benartzi.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Shading.
02/2/05© 2005 University of Wisconsin Last Time Reflectance part 1 –Radiometry –Lambertian –Specular.
Local Illumination and Shading
Non-Linear Kernel-Based Precomputed Light Transport Paul Green MIT Jan Kautz MIT Wojciech Matusik MIT Frédo Durand MIT Henrik Wann Jensen UCSD.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Radiosity Radiosity.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
CS552: Computer Graphics Lecture 33: Illumination and Shading.
Computer Graphics Lecture 30 Mathematics of Lighting and Shading - IV Taqdees A. Siddiqi
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Reflection Models (1) Physically-Based Illumination Models (2)
Basic Ray Tracing CMSC 435/634.
Shading CS 465 Lecture 4 © 2004 Steve Marschner • 1.
© University of Wisconsin, CS559 Spring 2004
Advanced Computer Graphics
Previous lecture Reflectance I BRDF, BTDF, BSDF Ideal specular model
Lighting.
Illumination Model How to compute color to represent a scene
UMBC Graphics for Games
CS5500 Computer Graphics May 29, 2006
The Rendering Equation
Computer Graphics (Fall 2003)
Presentation transcript:

Physically-Based Rendering UMBC Graphics for Games

A Little Multivariable Calculus Because I didn’t make it a prereq

Partial Derivatives Derivatives with respect to one variable, treat the rest as constant

Surface Integrals Integrate one variable at a time Concrete example

Change of Variables Disk in polar coordinates: Area scales with radius: Integral with area scaling:

Illumination

Illumination Effect of light on objects Mostly just look at intensity Apply to each color channel independently Good for most objects Not fluorescent Light enters at one wavelength, leaves as another Brighter green, yellow than we expect Not phosphorescent Light enters at one point in time, leaves later

Local vs. Global Local Global Photons leave light, bounce off of one surface, make it to eye Global Photons bouncing multiple times Ambient Illumination Approximate global illumination as a constant Typically ~1% of direct illumination Ambient Occlusion Approximate as a constant scaled by local visibility Harder for light to bounce into corners

BRDF Bidirectional Reflectance Distribution Function How much of Li makes it to Lo?

Physically Plausible BRDF Positive Reciprocity Same light from Li to Lo as from Lo to Li Can trace view to light or light to view Conservation of Energy Don’t put out more than comes in

Important directions L = position of light V = position of viewer P = position on surface = unit-length surface normal = unit vector toward light = unit vector toward view = half-way between and

Rendering Equation Integral of all incoming light Playing a little loose with the notation Really differential solid angles, not unit vectors: not

Rendering Equation outgoing light in direction hemisphere above P incoming light from direction BRDF from to projection of differential solid angle onto surface Like the for integrating in polar coordinates

Dot product part Less light per unit area of surface at steeper angles

Point Lights Light emitted an infinitesimally small point Intensity falls off with square of distance to the source For light at position , shining on a surface at point Light intensity

Spot Lights Lights with a direction and cone Just point lights with extra code to mask intensity For direction , mask based on AKA the cosine of the angle to the light axis

Directional Lights Really bright point light, really far away Basically, an optimization for the sun Far enough away is basically constant Far enough away that the squared distance is basically constant No falloff with distance

Punctual lights From the point of view of any single point on the surface, these all come from a single direction. Integral turns into a sum

More on BRDFs

Decompose BRDF BRDF = sum of convenient parts

Decompose BRDF + = BRDF = sum of convenient parts Typical breakdown Diffuse (view independent) Specular (view dependent glossy reflection) Others less common, often ignored (e.g. retro reflection) + =

Diffuse Also called Lambertian or Matte

About Pi [Legarde 2012] Common to have a ~3x too bright or ~3x too dark bug Often easier specify point lights with a scaled intensity Want intensity I at one unit distance with normal incidence and unit albedo So Simplifies lighting equation: If you use kd with a light that doesn’t have the , it’s 3.14x too bright If you use I as the intensity where you need Li, it’s 3.14x too dark

Microfacet Specular Model to construct physically plausible BRDFs Imagine random mirrored microfacets, too small to see Perfect reflectors, so only facets aligned with contribute Normal Distribution Function Probability density (on hemisphere of directions) that aligns with Geometry Term Proportion of facets blocked from the light (shadowing) or view (masking) Fresnel Term Reflection is stronger at glancing angles

Microfacet BRDF Original form by Cook & Torrance [1981] Often swap out D & G GGX (aka Trowbridge-Reitz) NDF [Walter et al. 2007] Smith geometry term for GGX [Walter et al. 2007, Karis 2013]

Fresnel n = index of refraction F0 = reflectance at normal incidence Air: 1; Water: 1.33; Ice; 1.31; Glass: 1.5; Diamond: 2.4 What matters is ratio between materials F0 = reflectance at normal incidence Air to Water: 0.02; Ice: 0.018; Glass: 0.04; Diamond: 0.17 Some games just use ~0.03 for everything Schlick approximation for dielectrics (aka non-metal) [Schlick 1994] Wrong for metals, need a different formula for them

Advanced Microfacets Distribution of visible facets [Heitz & D’Eon 2014] Combine D and G terms into a single joint probability density Multi-bounce [Heitz et al. 2016, Kulla & Conty 2017] Especially for rough surfaces, lose a ton of energy due to single bounce Model multiple bounces between microfacets (still part of BRDF) Ground truth: simulate multiple bounces Approximation: add a term to compensate for missing energy

Normal Map to BRDF When far away, variation in normal map blends to average normal Should push that variation into NDF Otherwise, muddy road (shiny with bumps) turns to mirror in the distance Plus, shiny normal maps alias like crazy LEAN mapping Model NDF as Gaussian, bumps as off-center Gaussians Best fit Gaussian to a mixture of Gaussians = blend moments Ignores shadowing, masking, Fresnel LEADR mapping (more accurate, more expensive) Model PDF of visible normals as off-center Gaussians (ignores Fresnel) Toksvig (less accurate, less expensive) Weighted average of unit-length normals will be less than unit length How much less depends on spread, can use to estimate NDF variance

Diffuse as Subsurface Fresnel F = proportion that reflects 1 – F is proportion that enters surface Subsurface: scale by 1 – F going in, F coming back out Diffuse is just subsurface scattered < 1 pixel [Jensen et al. 2001] Instead of BRDF = diffuse + specular Have

Environment Light

Beyond Points Especially reflection is affected by full environment Pre-convolved Reflection (aka Environment) map [Greene 1986] Approximate as Blur to approximate integral Precomputed Radiance Transfer (PRT) [Sloan et al. 2005] Glossy reflection as sum of Spherical Harmonics 9-17 coefficients for fixed basis functions

Area Lights

Beyond Points All real light comes from an area Affects shadows Even the sun is about ½º Affects shadows Softens diffuse Spreads specular

Area diffuse Multiple samples Overall approximation Exact Approximate area light as multiple point lights Overall approximation Above horizon, use center of light Below horizon, shift light direction & scale intensity Exact Polygonal shapes Closed form for integral of cosine (& powers of cosine) [Arvo 1995]

Area Specular Multiple samples Representative Point [Karis 2013] Approximate area light as multiple point lights Representative Point [Karis 2013] If mirror reflection direction lands in light source, use that point If it lands outside the light source, use the closest point in the light Arvo integral approximations Zonal Harmonics [Belcour et al. 2018] Single-axis subset of Spherical Harmonics Linearly Transformed Cosines [Heitz et al. 2016] Squish and stretch cosine (and projection of light shape) to match roughness