Skylight to enhance outdoor scenes Real-Time Graphics. The atmosphere. Rayleigh scattering. Jeppe Revall Frisvad.

Similar documents
Dynamic range Physically Based Rendering. High dynamic range imaging. HDR image capture Exposure time from 30 s to 1 ms in 1-stop increments.

The Rendering Equation and Path Tracing

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

A Survey of Modelling and Rendering of the Earth s Atmosphere

6. Illumination, Lighting

x ~ Hemispheric Lighting

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Lecture 7 - Path Tracing

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Shading Models. Welcome!

Illumination. The slides combine material from Andy van Dam, Spike Hughes, Travis Webb and Lyn Fong

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

Reflection models and radiometry Advanced Graphics

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

Radiance. Radiance properties. Radiance properties. Computer Graphics (Fall 2008)

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

CSE 167: Lecture #7: Color and Shading. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

Capturing light. Source: A. Efros

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

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

Electromagnetic waves and power spectrum. Rays. Rays. CS348B Lecture 4 Pat Hanrahan, Spring 2002

The Rendering Equation. Computer Graphics CMU /15-662

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

Photometric Stereo.

Ambien Occlusion. Lighting: Ambient Light Sources. Lighting: Ambient Light Sources. Summary

Council for Optical Radiation Measurements (CORM) 2016 Annual Technical Conference May 15 18, 2016, Gaithersburg, MD

Shading 1: basics Christian Miller CS Fall 2011

Monte Carlo Ray Tracing. Computer Graphics CMU /15-662

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

2/1/10. Outline. The Radiance Equation. Light: Flux Equilibrium. Light: Radiant Power. Light: Equation. Radiance. Jan Kautz

Realistic Camera Model

Understanding Variability

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

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

13 Distribution Ray Tracing

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

Illumination Under Trees. Nelson Max University of Tokyo, and University of California, Davis

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

Radiometry and reflectance

Illumination and Shading - II

Illumination. Courtesy of Adam Finkelstein, Princeton University

CSE 681 Illumination and Phong Shading

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

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

CSE 167: Introduction to Computer Graphics Lecture #6: Colors. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Lights, Surfaces, and Cameras. Light sources emit photons Surfaces reflect & absorb photons Cameras measure photons

Overview. Radiometry and Photometry. Foundations of Computer Graphics (Spring 2012)

Game Technology. Lecture Physically Based Rendering. Dipl-Inform. Robert Konrad Polona Caserman, M.Sc.

Visualisatie BMT. Rendering. Arjan Kok

Lighting and Materials

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

Shading and Illumination

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

CS5620 Intro to Computer Graphics

Announcements. Lighting. Camera s sensor. HW1 has been posted See links on web page for readings on color. Intro Computer Vision.

Parallel Monte Carlo Sampling Scheme for Sphere and Hemisphere

Wednesday, 26 January 2005, 14:OO - 17:OO h.

Lighting and Reflectance COS 426

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

EE Light & Image Formation

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Other approaches to obtaining 3D structure

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

Lecture 15: Shading-I. CITS3003 Graphics & Animation

TDA361/DIT220 Computer Graphics, January 15 th 2016

COMPUTER GRAPHICS COURSE. LuxRender. Light Transport Foundations

Lecture 22: Basic Image Formation CAP 5415

Introduction to Radiosity

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

Assignment #2. (Due date: 11/6/2012)

Illumination in Computer Graphics

Simple Lighting/Illumination Models

Modelling of radiative heat transfer applying computer graphics software

The Rendering Equation & Monte Carlo Ray Tracing

Illumination & Shading: Part 1

Glossy Reflection. Objectives Modeling

Radiometry. Reflectance & Lighting. Solid Angle. Radiance. Radiance Power is energy per unit time

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

Outline of Lecture. Real-Time High Quality Rendering. Geometry or Vertex Pipeline. Basic Hardware Pipeline. Pixel or Fragment Pipeline

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

Objectives. Introduce Phong model Introduce modified Phong model Consider computation of required vectors Discuss polygonal shading.

Real-Time Realistic Rendering of Nature Scenes with Dynamic Lighting

Announcement. Lighting and Photometric Stereo. Computer Vision I. Surface Reflectance Models. Lambertian (Diffuse) Surface.

BRDF Computer Graphics (Spring 2008)

MONTE-CARLO PATH TRACING

Introduction to Computer Vision. Introduction CMPSCI 591A/691A CMPSCI 570/670. Image Formation

Class 11 Introduction to Surface BRDF and Atmospheric Scattering. Class 12/13 - Measurements of Surface BRDF and Atmospheric Scattering

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

Computer Graphics. Illumination and Shading

782 Schedule & Notes

Light Field = Radiance(Ray)

Real-Time Photorealistic Terrain Lighting

Announcements. Radiometry and Sources, Shadows, and Shading

Topic 2: Reflection 1

Spectral Color and Radiometry

Reflection and Shading

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

Transcription:

Skylight to enhance outdoor scenes 02564 Real-Time Graphics Skylight and irradiance environment maps Jeppe Revall Frisvad March 2016 Esplanade, Saint Clair, Dunedin, New ealand: -45.9121, 170.4893 The atmosphere Kamaole Beach Park, Maui, Hawaii, USA: 20.717, -156.447 Rayleigh scattering Quote from Lord Rayleigh [On the light from the sky, its polarization and colour. Philosophical Magazine 41, pp. 107 120, 274 279, 1871]: f represent the intensity of the primary light after traversing a thickness x of the turbid medium, we have 4 d = k λ dx, where k is a constant independent of λ. On integration, Reference - Bele m, A. L. Modeling Physical and Biological Processes in Antarctic Sea ce. PhD Thesis, Fachbereich Biologie/Chemie der Universita t Bremen, February 2002. = 0 e kλ 4 x, if 0 correspond to x = 0, a law altogether similar to that of absorption, and showing how the light tends to become yellow and finally red as the thickness of the medium increases.

Solar radiation Colorimetry - - XY gamut RGB gamut CRT/LCD monitor gamut CE color matching functions R = G = B = The chromaticity diagram Cλ) rλ) dλ V Cλ)ḡλ) dλ V Cλ) bλ) dλ, V [Source: http://en.wikipedia.org/wiki/sunlight] where V is the interval of visible wavelengths and Cλ) is the spectrum that we want to transform to RGB. Gamut mapping Dynamic range Gamut mapping is mapping one tristimulus color space to another. Gamut mapping is a linear transformation. Example: X 0.4124 0.3576 0.1805 R Y = 0.2126 0.7152 0.0722 G. 0.0193 0.1192 0.9505 B R 3.2405 1.5371 0.4985 X G = 0.9693 1.8760 0.0416 Y B 0.0556 0.2040 1.0572 Y in the XY color space is called luminance. Luminance is a measure of how bright a scene appears. From the linear transformation above, we have Y = 0.2126 R + 0.7152 G + 0.0722 B. Ambient luminance levels for some common lighting environments: Reference Condition llumination cd/m 2 ) Starlight Moonlight 10 1 ndoor lighting 10 2 Sunlight 10 5 10 3 Maximum intensity of common monitors 10 2 - Reinhard, E., Ward, G., Pattanaik, S., Debevec, P., Heidrich, W., and Myszkowski, K. High Dynamic Range maging: Acquisition, Display and mage-based Lighting, second edition, Morgan Kaufmann/Elsevier, 2010.

Tone mapping Analytical sky models [Preetham et al. 1999] input parameters) Simplistic tone mapping: scale and gamma correct: R, G, B ) = s R 1/γ, G 1/γ, B 1/γ). where s and γ are user-defined parameters. The framework uses s = 0.025 and γ = 1) for the sun and sky. Another tone mapping operator: R, G, B ) = 1 e R ) 1/γ, 1 e G ) 1/γ, 1 e B ) 1/γ). This is useful for avoiding overexposed pixels. Other tone mapping operators use sigmoid functions based on the luminance levels in the scene [Reinhard et al. 2010]. Solar declination angle: Solar position: ) 2πJ 81) δ = 0.4093 sin. 368 θ s = π 2 arcsin sin l sin δ cos l cos δ cos πt ) 12 cos δ sin πt ) 12 φ s = arctan cos l sin δ sin l cos δ cos πt, 12 where J [1, 365] is Julian day, t is solar time, and l is latitude., Direct sunlight Skylight Assume the Sun is a diffuse emitter of total power Φ = 3.91 10 26 W and surface area A = 6.07 10 18 m 2. m 2 sr. Radiance from the Sun to the Earth: L = Φ πa 2.05 107 W Assume the Sun is in zenith and at a distance to the Earth of r = 1.5 10 11 m. The solid angle subtended by the Sun as seen from Earth: ω = As = A 6.74 10 5 sr. r 2 4r 2 Energy received in a 1 1 m 2 patch of Earth atmosphere: E = Lω 1383 W m 2. A directional source with its color set to the solar irradiance at Earth will deliver the same energy in a square meter. Environment mapping: Map an omnidirectional image onto everything surrounding the scene. Cube mapping: Use a direction to perform look-ups into an omnidirectional image consisting of six texture images square resolution, 90 field of view). We use Preetham s analytical model to precompute a sky cube map. Look-ups then return the radiance L sky ω) received from the sky when looking in the direction ω.

Precomputing a cube map Environment mapping +y We precompute by storing L sky v ijk ) in the texel at index i, j of face k. v ijk = a k + u k 2 i )+ res 1 b k 2 j ) res 1, -z -x +z Folded where the faces are numbered from 0 to 5 and ordered as follows: left, right, top, bottom, front, back a k is the major axis direction of face k, u k is the up direction of face k, and bk is the right direction of face k. +z Right +z Top Front -z Left -x Back Reflective environment mapping: i = p e p e ), r = i 2 n i n. We need world space directions when looking up in a cube map. -z B ottom Unfolded r w = V 1) 3 3 r, where V is the view matrix and A 3 3 takes the upper left 3 3 part of A. Environment mapping - filling the background The Rendering Equation Object World Eye Model View Clip W divide Normalized device Projection Viewport Window Given window space pixel coordinates x p, y p find the direction from the eye to the corresponding point on the image plane. 0 i w = V 1 ) 2 xp W 1 3 3 0 0 P 1 p n, p n = 2 yp H 1 0. 0 0 0 0 1 When rendering surfaces, the equation we try to evaluate is [Kajiya 1986] L o x, ω) = L e x, ω) + f r x, ω, ω)l i x, ω ) cos θ dω, 2π where L o is outgoing radiance, L e is emitted radiance, L i is incoming radiance, x is a surface position, ω is the direction of the light, ω is the direction toward the light source, f r is the bidirectional reflectance distribution function BRDF), dω is an element of solid angle, θ is the angle between ω and the surface normal n at x, such that cos θ = ω n. References - Kajiya, J. The Rendering Equation. Computer Graphics Proceedings of ACM SGGRAPH 86) 204), pp. 143 150, 1986. Note that depth is unimportant as i w is the direction of an eye ray.

Splitting the evaluation Sky irradiance Esky and ambient occlusion A Distinguishing between: Direct illumination Ldirect. Light reaching a surface directly from the source. ndirect illumination Lindirect. Light reaching a surface after at least one bounce. where The rendering equation is then L = Le + Ldirect + Lindirect. Le is emission. Ldirect is sampling of lights. Lindirect is sampling of the BRDF excluding lights. n a real-time skylight setting: Ldirect is direct sunlight using the Phong illumination model without ambient). Lindirect is integrated skylight and specular reflection of the sky. ntegrating skylight Excluding direct sunlight from Li, we have Lindirect x, ω ~o) = fr x, ω ~ 0, ω ~ )Li x, ω ~ i )~ 2π ρd V x, ω ~ i )Lsky ~ ωi )~ + ρs V x, ~r )Lsky ~rw ), = π 2π Li x, ω ~ i ) = V x, ω ~ i )Lsky ~ ωi ) is incident skylight, fr x, ω ~ 0, ω ~ ) = ρd /π is the BRDF of perfectly diffuse Lambertian) materials, ρd is the diffuse reflectance diffuse color), and ρs is the specular reflectance. The remaining integral is called the irradiance E, and E x, n~) = V x, ω ~ i )Lsky ~ ωi )~ 2π 1 V x, ω ~ i )~ Lsky ~ ωi )~ π 2π Ω = Ax)Esky ~ n). rradiance environment map The sky irradiance integral neglecting visibility): Esky ~ n) = Lsky ~ ωi )~. 2π Monte Carlo estimator: Esky,N ~ n) = N ωi,j )~ ~ i,j ) 1 X Lsky ~. N pdf~ ωi,j ) skylight j=1 to sky irradiance ~ ~ n ω A good choice of pdf would be pdf~ ωi,j ) = πi,j. We sample ω ~ i,j on a cosine-weighted hemisphere using p θi, φi ) = cos 1 1 ξ1, 2πξ2 ), ξ1, ξ2 [0, 1) random numbers) x, y, z) = cos φi sin θi, sin φi sin θi, cos θi ) nx ny /1 + nz ) 1 nx2 /1 + nz ) nx ω ~ i,j = x nx ny /1 + nz ) + y 1 ny2 /1 + nz ) + z ny. nx nz ny Precompute cube map on the GPU using layered rendering and sampling. n the geometry shader integrator.geom): emit triangle vertices to each cube map face using a loop and gl Layer. n the fragment shader integrator.frag): implement the cosine-weighted sampling of the skylight with n~ = ~vijk use rndt) to get a random number). The framework progressively improves the sky irradiance map using these shaders.

llumination model for skylight where L r = ρ d π n l ) )V L sun + A E sky n w ) + ρ s r l ) ) p V L sun + L sky r w ), L sun is the radiance color) of the directional light, L sky is a look-up into the skylight environment map, E sky is a look-up into the sky irradiance map, V is the visibility term obtained from shadow mapping, A is the factor from screen-space ambient occlusion SSAO), n is the normal, l is the direction toward the sun, r is the reflection of the view vector around the normal, n w is the normal in world coordinates, r w is the reflected vector in world coordinates, ρ d is a diffuse reflectance, ρ s is a specular reflectance, and p is a shininess.