Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power...

46
Physically Based Rendering (600.657) Color & Radiometry

Transcript of Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power...

Page 1: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Physically Based Rendering (600.657)

Color & Radiometry

Page 2: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Spectral Power Distribution (SPD):

Represents the distribution of light across wavelengths.

– Visible light: 370-730 nm

– Blue ~400 nm, green ~550 nm, red ~650 nm

Fluorescent light Lemon skin [Images courtesy of PBRT]

Page 3: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Spectral Power Distribution:

In general, we discretize the spectrum by expressing it as the linear combination of basis functions:

Page 4: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Spectral Power Distribution:

In general, we discretize the spectrum by expressing it as the linear combination of basis functions:

– Piecewise constant

Page 5: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Spectral Power Distribution:

In general, we discretize the spectrum by expressing it as the linear combination of basis functions:

– Piecewise constant

– Piecewise linear

Page 6: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Spectral Power Distribution:

In general, we discretize the spectrum by expressing it as the linear combination of basis functions:

– Piecewise constant

– Piecewise linear

– Etc.

Page 7: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Aside:

Given a set of basis functions {B1(x),…, Bn(x)} how do we find the best approximation to a signal F(x)?

Page 8: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Aside:

Given a set of basis functions {B1(x),…, Bn(x)} how do we find the best approximation to a signal F(x)?

Goal:

Find coefficients {1,…, n} minimizing:

dxxBxF i

n

i

i

2

1

)()(

Page 9: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Goal:

Find coefficients {1,…, n} minimizing:

n

ji

jiji

n

i

iii

n

i

i

dxxBxB

dxxFxB

xF

dxxBxF

1,

1

2

2

1

)()(

)()(2

)(

)()(

Page 10: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Goal:

Find coefficients {1,…, n} minimizing:

Taking derivatives with respect to the i gives:

n

ji

jiji

n

i

iii

n

i

i

dxxBxB

dxxFxB

xF

dxxBxF

1,

1

2

2

1

)()(

)()(2

)(

)()(

dxxFxBdxxBxB i

n

j

jij )()()()(1

Page 11: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Goal:

Find coefficients {1,…, n} satisfying:

So the coefficients are the solution to the linear system A{i}=b where:

dxxFxBb

dxxBxBA

ii

jiij

)()(

)()(

dxxFxBdxxBxB i

n

j

jij )()()()(1

Page 12: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Note:

For piecewise constant approximation, the basis functions are orthonormal:

otherwise0

if1)()(

jidxxBxBA jiij

Page 13: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Note:

For piecewise constant approximation, the basis functions are orthonormal:

So A is the identity and we have:

otherwise0

if1)()(

jidxxBxBA jiij

5.0

5.0

)(

i

i

i dxxF

Page 14: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Note:

For piecewise linear approximation, the basis functions are not orthonormal and computing the coefficients requires solving a linear system.

Page 15: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Color

Note:

For piecewise linear approximation, the basis functions are not orthonormal and computing the coefficients requires solving a linear system.

In practice, we still approximate the coefficient by averaging:

5.0

5.0

)(

i

i

i dxxF

Page 16: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

XYZ Color

Tristimulus Theory:

For human observers, every SPD can be characterized by three values. These are obtained by integrating the SPD against spectral matching curves X(),Y(), Z():

dY

dZSz

dY

dYSy

dY

dXSx

S

S

S

)(

)()(

)(

)()(

)(

)()(

Page 17: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

XYZ Color

Tristimulus Theory:

For human observers, every SPD can be characterized by three values. These are obtained by integrating the SPD against spectral matching curves X(),Y(), Z():

dY

dZSz

dY

dYSy

dY

dXSx

)(

)()(

)(

)()(

)(

)()(

Note: This does not mean that:

S()=xSX()+ySY()+zSZ()

Page 18: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

XYZ Color

Tristimulus Theory:

For human observers, every SPD can be characterized by three values. These are obtained by integrating the SPD against spectral matching curves X(),Y(), Z():

dY

dZSz

dY

dYSy

dY

dXSx

)(

)()(

)(

)()(

)(

)()(

Note: This does not mean that:

S()=xSX()+ySY()+zSZ() Note: Many different SPDs can have the same characteristic (xS,yS,zS). These look the same to the human eye and are called metamers.

Page 19: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

RGB Color

Displays:

Given a display emitting in red, green, and blue and given an SPD S(), we want to compute the RGB values such that when the display emits with those values, the color will appear the same as the color represented by S().

LCD

LED

Page 20: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

RGB Color

Displays:

If the red, green, and blue SPDs emission of the display are given by R(), G(), B(), this gives:

dY

dZbBgGrR

dY

dZSz

dY

dYbBgGrR

dY

dYSy

dY

dXbBgGrR

dY

dXSx

S

S

S

)(

)()()()(

)(

)()(

)(

)()()()(

)(

)()(

)(

)()()()(

)(

)()(

Page 21: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

RGB Color

Displays:

If the red, green, and blue SPDs emission of the display are given by R(), G(), B(), this gives:

b

g

r

dZBdZGdZR

dYBdYGdYR

dXBdXGdXR

dYz

y

x

S

S

S

)()()()()()(

)()()()()()(

)()()()()()(

)(

1

[This is different from the formulation in PBRT!?!]

Page 22: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

RGB Color to SPD

Absent specific emission profiles for a particular display, we would like a reasonable way to transform RGB values to SPDs:

• R=G=B the SPD should be constant

• The SPD should be smooth

Page 23: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

RGB Color to SPD

Approach:

Specify SPDs for white, RGB, and CMY. (These can be different for reflection and illumination.)

Page 24: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

RGB Color to SPD

Approach:

Specify SPDs for white, RGB, and CMY. (These can be different for reflection and illumination.)

Given an RGB triplet (r,g,b) iteratively subtract off values from the triplet to zero out components and update the SPD accordingly.

Page 25: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

RGB Color to SPD

Example (r0,g0,b0)= ( 0.6 , 0.2 , 0.5 ):

1. Green is smallest of three:

(r1,g1,b1) = (r0,g0,b0) - (g0,g0,g0) S() += g0 W()

Page 26: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

RGB Color to SPD

Example (r1,g1,b1)= ( 0.4 , 0.0 , 0.3 ):

1. Green is smallest of three :

(r1,g1,b1) = (r0,g0,b0) - (g0,g0,g0) S() += g0 W()

2. Blue is smallest of two:

(r2,g2,b2) = (r1,g1,b1) - (b1,0,b1) S() += b1 M()

Page 27: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

RGB Color to SPD

Example (r2,g2,b2)= ( 0.1 , 0.0 , 0.0 ):

1. Green is smallest of three :

(r1,g1,b1) = (r0,g0,b0) - (g0,g0,g0) S() += g0 W()

2. Blue is smallest of two:

(r2,g2,b2) = (r1,g1,b1) - (b1,0,b1) S() += b1 M()

3. Red is left:

(r3,g3,b3) = (r2,g2,b2) - (r2,0,0) S() += r2 R()

Page 28: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

RGB Color to SPD

Example (r3,g3,b3)= ( 0.0 , 0.0 , 0.0 ):

1. Green is smallest of three :

(r1,g1,b1) = (r0,g0,b0) - (g0,g0,g0) S() += g0 W()

2. Blue is smallest of two:

(r2,g2,b2) = (r1,g1,b1) - (b1,0,b1) S() += b1 M()

3. Red is left:

(r3,g3,b3) = (r2,g2,b2) - (r2,0,0) S() += r2 R()

Note: This mapping from RGB-space to SPDs is not linear.

Page 29: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Terms:

• Flux

• Irradiance / Radiant Exitance

• Intensity

• Radiance

Page 30: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Flux ():

Measures the total amount of energy passing through a surface per unit time [measured in W].

– Used to describe the total emission from lights.

– (In 2D, the flux through a closed curve around a light source is related to the winding number of the curve.)

S1 S2

Page 31: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Irradiance / Radiant Exitance (E/M):

The area density of flux arriving/leaving a surface [measured in W/m2].

– Integrating the irradiance / radiant exitance we get the flux:

Sp

dppES )()(

S1 S2

Page 32: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Irradiance / Radiant Exitance (E/M):

The area density of flux arriving/leaving a surface [measured in W/m2].

– Integrating the irradiance / radiant exitance we get the flux:

Example:

If a point emits isotropicaly, the radiance on a sphere of radius r about the light is:

Sp

dppES )()(

S1 S2

2

2

4 4)(

rEErdpEdppE

SpSp

Page 33: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Irradiance / Radiant Exitance (E/M):

The area density of flux arriving/leaving a surface [measured in W/m2].

– Integrating the irradiance / radiant exitance we get the flux:

Lambert’s Law:

Irradiance at a surface varies with the cosine of the angle of incidence:

Sp

dppES )()(

AAAE i

ii

cos

cos/

A

Ai

i

Page 34: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Intensity (I):

The solid angle density of flux emanating from a point light source [measured in W/steridian].

C

S p

S

dIC )()(

Page 35: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Intensity (I):

The solid angle density of flux emanating from a point light source [measured in W/steridian].

Example:

If a point emits isotropicaly, the intensity at any direction is:

S

dIC )()(

4

42

IIdI

S

Page 36: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Intensity (I):

The solid angle density of flux emanating from a point light source [measured in W/steridian].

Warn’s Spotlight:

S

dIC )()(

ss lI ,cos)(

l

[Images courtesy of Pat Hanarhan]

Page 37: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Intensity (I):

The solid angle density of flux emanating from a point light source [measured in W/steridian].

Warn’s Spotlight:

S

dIC )()(

1

0

2/

0

2

0

2/

01

22sin cos2 sincos,

2 sdxxddddl ss

HS

ss

ss lI ,cos)(

l

cos,sinsin,sincos

[Images courtesy of Pat Hanarhan]

Page 38: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Radiance (L):

The solid angle and area density of flux [measured in W/(steridianm2)].

– Note that the measure of area is along A, the direction perpendicular to .

,ndAdA

n

Page 39: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Radiance (L):

The solid angle and area density of flux [measured in W/(steridianm2)].

– Note that the measure of area is along A, the direction perpendicular to .

,ndAdA

n

Radiance does not “know” about the surface orientation at the point of interest.

Page 40: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Radiometry

Radiance (L):

The solid angle and area density of flux [measured in W/(steridianm2)].

– Note that the measure of area is along A, the direction perpendicular to .

– For a point on the surface, we will consider both incident (Li) and exitant (Lo) radiance.

n

Page 41: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

i

Radiometry

Radiance (L):

The solid angle and area density of flux [measured in W/(steridianm2)].

For a patch on a surface, the irradiance is the integral of the radiance over all incoming directions, scaled by the change in area term:

A

dLE

HS

i cos)(2

Page 42: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

o

Radiometry

Radiance (L):

The solid angle and area density of flux [measured in W/(steridianm2)].

Similarly, the flux emitted from an object is the integral of the radiance in all outgoing directions, scaled by the change in area, and integrated over the surface of the object:

A

A HS

o dAdL cos)(2

Page 43: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Bidirectional Reflectance Distribution

Gives the ratio of outgoing radiance in direction o to the irradiance on the surface from incoming direction i.

iiii

oo

i

oooir

dpL

pdL

pdE

pdLpf

cos),(

),(

),(

),(),,(

Page 44: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

BRDF

Gives the ratio of outgoing radiance in direction o to the irradiance on the surface from incoming direction i.

Thus, given a BRDF fr(p,i,o) and the incoming radiance Li(p,i), the outgoing radiance in o is:

iiii

oo

i

oooir

dpL

pdL

pdE

pdLpf

cos),(

),(

),(

),(),,(

2

cos),(),,(),(

S

iiiioiroo dpLpfpL

Page 45: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

Bidirectional Scattering-Surface Reflectance Distribution Function

Gives the ratio of outgoing radiance in direction o at point po, to the irradiance on the surface from incoming direction i at point pi.

),(

),(),,,(

ii

oooooii

pdE

pdLppS

Page 46: Physically Based Rendering (600.657) - Department of ...misha/Fall11/5.pdfColor Spectral Power Distribution (SPD): Represents the distribution of light across wavelengths. –Visible

BSSRDF

Gives the ratio of outgoing radiance in direction o at point po, to the irradiance on the surface from incoming direction i at point pi.

Thus, given a BSSRDF S and the incoming radiance Li the outgoing radiance in o at po is:

dAdpLppSpLA S

iiiiiooiiooo cos),(),,,(),(2

),(

),(),,,(

ii

oooooii

pdE

pdLppS