cs563 wk9 skin participating media - wpiweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf ·...

43
CS 563 Advanced Topics in Computer Graphics Skin and Participating Media by Emmanuel Agu

Upload: others

Post on 09-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

CS 563 Advanced Topics in Computer Graphics

Skin and Participating Media

by Emmanuel Agu

Page 2: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Outline

NvidiaOptix Real Time Ray tracerShader library

SkinBSSRDFDipole Model (Donner and Jensen)Multiple Dipole (Donner and Jensen)

Participating MediaExamplesModel

Page 3: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Optix Real Time Raytracer

Ray tracing on GPUs been hot research topicNew games, applications incorporating ray tracingNvidia written real time ray tracerReleased SDK to developersNeeds high end Nvidia graphics card

Page 4: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Nvidia Shader Library

Some useful examples: worth taking a lookDrawback: Have to infer non-real time caseGreat implementation insights

Page 5: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Note: BSSRDF formulated by Nicodemus et al, accountsFor light entering at one point/angle and leaving at another

Page 6: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B
Page 7: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B
Page 8: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Subsurface Scattering

Stam ‘95: first to model multiple scattering as a diffusion processJensen et al SIGGRAPH ‘01: BSSRDF + Diffusion approximation of multiple scatteringSingle scattering + diffusion approximationEven highly scattering medium becomes blur since each scattering blurs lightSimple solution for 1 isotropic source in infinite medium

Page 9: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B
Page 10: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B
Page 11: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Dipole Diffusion Approximation

More accurateReplace volumetric light source with 2 point light sources (one above surface, one below)

Page 12: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B
Page 13: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B
Page 14: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B
Page 15: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Multiple Dipole ModelDonner and Jensen, SIGGRAPH ‘05

Dipole approximation assumed homogeneous medium and semi-infinite thicknessMultiple dipole model: Multiple layers, different optical properties, arbitrary thicknessApply Kubelka Munk theory in freq space

Page 16: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Spectral Rendering ModelDonner and Jensen, SIGGRAPH ‘06

Accounts for both surface reflection and subsurface scatteringUses only 4 parameters, amount of oil, melanin andhaemoglobin in skin generate spectral diffusion profiles by modelling skin as two-layer translucent material using the mutipolediffusion approximation

Page 17: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Spectral Rendering ModelDonner and Jensen, SIGGRAPH ‘06

Two-layer translucent materialVery accurate results

Page 18: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Participating Media

So far assumed vacuum: radiance unchanged along rayParticipating media affects radiance along ray

AbsorptionEmissionScattering

In-scatteringOut-scattering

Examples of participating media (volume scattering)AtmosphereSmokeHazeClouds

Some media homogenous, some inhomogenous

Page 19: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Volume Scattering Processes

Absorption

Emission

Page 20: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Volume Scattering Processes

Scattering

Page 21: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Volume Scattering Processes

HomogeneousConstant particle densityUniform particle types distribution

InhomogeneousVarying particle densityVarying particle distribution

Page 22: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Volume Scattering Processes

AbsorptionLight is absorbed by mediumRay radiance decreases through the medium

Absorption crossed section σaLight absorption probability density per unit distance traveled in mediumUnits → m-1

dt → through-medium-travel unitValues may be larger than 1

Influence factorsPosition (p)Direction (ω)Spectrum

Page 23: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Volume Scattering Processes

Change in radiance per unitDifference between incoming and outgoing radiance

),(),(),( ωωω pLpLpdL ioo −=

Page 24: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Volume Scattering Processes

( ) ( ) ( )∫=++−

da dtt

eLdL 0,

,,ωωσ

ωωωp

ppLo Li

σa integrated in d

Probability density function

Absorbed radiance Traveled a distance d through medium

Normal probability density function (Gaussian)

Page 25: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Absorption

Page 26: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Emission

EmissionLight is emitted by the medium

Emitted radiance:Independent of incoming light

Change in radiance per unit

),( ωpLve

dtpLpdL veo ),(),( ωω =

Page 27: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Emission

Page 28: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Out-Scattering

Out-scatteringLight is scattered out of the path of the rayProbability density for scattering: σs

Reduction in radiance is given by

dtpLppdL iso ),(),(),( ωωσω −−=

Page 29: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Extinction

Total radiance reductionAbsorptionScattering

Attenuation or extinction

Coefficient: σt

Change in radiance per unit

),(),(),( ωσωσωσ ppp sat +=

dtpLppdL ito ),(),(),( ωωσω −−=

Page 30: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Beam Transmittance

Beam transmittance Tr

( ) ( )

( ) ( ) ( )ω

ωωσ

,

0,

pppppp

p

LTLeT

r

dtt

r

dt

′→=′

∫=′→+−

Lo Li

σt integrated along d (p to p’)

Probability density function

Li(p,ω)

Page 31: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Transmittance

TransmittanceFraction of light that is transmitted between two pointsValues between 0 and 1Properties

Tr(p→p) = 1In vacuum: Tr(p→p’) = 1, for all p’Multiplicative: Tr(p→p’’) = Tr(p→p’) Tr(p’→p’’)

Page 32: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Beer’s Law

( ) ( )

( ) ( ) ( )ω

ωωσ

,

0,

pppppp

p

LTLeT

r

dtt

r

dt

′→=′

∫=′→+−

( ) ( )∫ +=′→ dt dtt0 ,ωωστ ppp

( ) dr

teT σ−=′→ pp

Optical thickness

Homogeneous mediumσt is position independentTransmittance reduced to Beer’s Law

Page 33: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Beer’s Law

Beer’s Law

lcA α=

αA = amount of light absorbed

= Absorption coefficient or molar absorptivity of mediuml = distance light travels through mediumc = Concentration or particle density

Page 34: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

In-Scattering

In-scatteringOutside light scatters converging to ray pathPhase functions to represent scattered radiation in a point

Page 35: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Volume Scattering Processes

Phase function (PF)Volumetric analog of BSDF Normalization constraints

PF defines a direction’s scattering probability distribution

Change in radiance per unit

( ) 12

=′′→∫S dp ωωω

dtpSpdLo ),(),( ωω =

Page 36: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

( ) ( )

( ) ( ) ( ) ( ) ( )∫ ′′→′−+=

=

2,,,,,

,,

S isve

o

dLpLS

Sdt

dL

ωωωωωσωω

ωω

ppppp

pp

Volume Scattering Processes

S(p,w) includes volume emission

Emission In-scattering

In-scatteringProbability Amount of added radiance

Phase function(range: 0 → 1) Incident radiance

Page 37: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Phase Functions

BSDFs for volume scatteringVary complexity according to medium

Isotropic Anisotropic

PropertiesDirection reciprocityMay also be classified as

Isotropic – uniform scatteringAnisotropic – variable scattering

Page 38: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Phase Functions

IsotropicBasic PFsPFs is constant

SinceArea of sphere = 4л*r2pfS are normalized (r =1)

( )π

ωω41

=′→isotropicp

Page 39: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Phase Functions

RayleighVery small particlesAcurately describes light scattering when

Particle radii < light wavelengthGood for atmospheric simulation

MieBased on Maxwell’s equationsBroader range of particle sizesGood for fog and water droplets simulation

Page 40: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Phase Functions

Henyey and GreensteinEasy to fitSingle control parameter

Controls relative proportion of forward backward scatteringg ∈ (-1, 1)g < 0: back scattering

( )( )( ) 232

2

cos211

41:cos

θπθ

ggggpHG

−+

−=

Page 41: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B
Page 42: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

Phase Functions

Increase complexity by combination

More efficient versionAvoids 3/2 power computationk ~ 1.55g - 0.55g 3

( ) ( )∑=

=n

iiHGi gpwp

1:coscos θθ

( )( )2

2

cos11

41cos

θπθ

kkpSchlick −

−=

Page 43: cs563 wk9 skin participating media - WPIweb.cs.wpi.edu/.../wk9...skin_participating_media.pdf · References Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B

References

Paulo Gonçalves de Barros, CS 563 talk, Spring 2008 Pat Hanrahan, CS 348B slides, 2009Matthias Zwicker, UCSD CSE 168 slides, Spring 2006Clemens Brandorf, Rendering Human skin

• Hill and Kelley, Computer Graphics using OpenGL (3rd edition)Matt Pharr, Greg Humphreys “Physically Based Rendering”, Chapter 13Dorsey and Rushmeier, Modeling of Digital MaterialsAkenine-Moller, Haines and Hoffman, Real Time Rendering, 3rd

edition