28
Illumination and Direct Reflection Kurt Akeley CS248 Lecture 12 1 November 2007 http://graphics.stanford.edu/courses/cs248-07/

Illumination and Direct Reflection Kurt Akeley CS248 Lecture 12 1 November 2007

  • View
    221

  • Download
    0

Embed Size (px)

Citation preview

Illumination and Direct Reflection

Kurt Akeley

CS248 Lecture 12

1 November 2007

http://graphics.stanford.edu/courses/cs248-07/

CS248 Lecture 12 Kurt Akeley, Fall 2007

Quantum electrodynamics

We’re not going to talk about

this

CS248 Lecture 12 Kurt Akeley, Fall 2007

Our premise

Goals:

Communicate, take advantage of human perception, and/or

Model reality

Radiative heat-transfer approximation

Treat light as packets of energy (photons)

Model their transport as a flow

Simplifications:

Ignore QED effects Diffraction, interference, polarization, …

Assume geometric optics Photons travel in straight lines

Intensities can be added

CS248 Lecture 12 Kurt Akeley, Fall 2007

Point Light Source

CS248 Lecture 12 Kurt Akeley, Fall 2007

Irradiance

d

dA

F=E

( )

( )

( )

( )

2

flux, radiated power W

irradiance, incident power on a surface W m

sr Steradian, unit solid angle (a full sphere is 4 sr)

radiant intensity given off by a point light source W sr

radiant intens

p

w

F =

=

=

=

=

E

I

Iuv

( )

( )( ) ( )

( )

( )( )

2

2

2

ity in direction W sr

differential unit area m

differential unit area oriented in direction m

differential unit solid angle sr

radiance given off by a (projected) surface W sr m

r

dA

dA

d

w

w w

w

w

=

=

=

=

=

L

L

uv

uv uv

uv( )2adiance in direction W sr mw

uv

CS248 Lecture 12 Kurt Akeley, Fall 2007

Solid angles

d

dA

F=E

( )

( )

( )

( )

2

flux, radiated power W

irradiance, incident power on a surface W m

sr Steradian, unit solid angle (a full sphere is 4 sr)

radiant intensity given off by a point light source W sr

radiant intens

p

w

F =

=

=

=

=

E

I

Iuv

( )

( )( ) ( )

( )

( )( )

2

2

2

ity in direction W sr

differential unit area m

differential unit area oriented in direction m

differential unit solid angle sr

radiance given off by a (projected) surface W sr m

r

dA

dA

d

w

w w

w

w

=

=

=

=

=

L

L

uv

uv uv

uv( )2adiance in direction W sr mw

uv

wuv

Area=1

1 sr

CS248 Lecture 12 Kurt Akeley, Fall 2007

Radiant Intensity (point source, uniform)

d

dA

F=E ( ) d

dw

wF

=Iuv

( )

( )

( )

( )

2

flux, radiated power W

irradiance, incident power on a surface W m

sr Steradian, unit solid angle (a full sphere is 4 sr)

radiant intensity given off by a point light source W sr

radiant intens

p

w

F =

=

=

=

=

E

I

Iuv

( )

( )

( )( ) ( )

( )( )

2

2

2

ity in direction W sr

differential unit solid angle sr

differential unit area m

differential unit area oriented in direction m

radiance given off by a (projected) surface W sr m

r

d

dA

dA

w

w

w w

w

=

=

=

=

=

L

L

uv

uv uv

uv( )2adiance in direction W sr mw

uv

W

4p=I

CS248 Lecture 12 Kurt Akeley, Fall 2007

Radiant Intensity (point source, nonuniform)

d

dA

F=E ( ) d

dw

wF

=Iuv

( )

( )

( )

( )

2

flux, radiated power W

irradiance, incident power on a surface W m

sr Steradian, unit solid angle (a full sphere is 4 sr)

radiant intensity given off by a point light source W sr

radiant intens

p

w

F =

=

=

=

=

E

I

Iuv

( )

( )

( )( ) ( )

( )( )

2

2

2

ity in direction W sr

differential unit solid angle sr

differential unit area m

differential unit area oriented in direction m

radiance given off by a (projected) surface W sr m

r

d

dA

dA

w

w

w w

w

=

=

=

=

=

L

L

uv

uv uv

uv( )2adiance in direction W sr mw

uv

wuv

dw

CS248 Lecture 12 Kurt Akeley, Fall 2007

Radiant Intensity (point source, nonuniform)

d

dA

F=E ( ) d

dw

wF

=Iuv

2

dAd

rw=

r

wuv

dw

dA

( )

( )

( )

( )

2

flux, radiated power W

irradiance, incident power on a surface W m

sr Steradian, unit solid angle (a full sphere is 4 sr)

radiant intensity given off by a point light source W sr

radiant intens

p

w

F =

=

=

=

=

E

I

Iuv

( )

( )

( )( ) ( )

( )( )

2

2

2

ity in direction W sr

differential unit solid angle sr

differential unit area m

differential unit area oriented in direction m

radiance given off by a (projected) surface W sr m

r

d

dA

dA

w

w

w w

w

=

=

=

=

=

L

L

uv

uv uv

uv( )2adiance in direction W sr mw

uv

CS248 Lecture 12 Kurt Akeley, Fall 2007

Illumination (point source)

Of an oriented unit area by a point light source

nliq

r

dw

dA

( )

( )

( )

( )

2

2

2

cos

cos

i

i i

i i

i

d

dA

d

dA

dA

dA r

r

r

w w

w q

w q

w

F=

=

=

×=

E

I

I

I

n lI

uv

uv

uv

uv

( ) d

dw

wF

=Iuv

2cos i

dAd

rw q= ×

iwuv

r dA>>

definition

cancellation

dot product def.

Projected area factor

cos idA q×

CS248 Lecture 12 Kurt Akeley, Fall 2007

Reflected Light

CS248 Lecture 12 Kurt Akeley, Fall 2007

Radiance (from oriented differential area)

d

dA

F=E ( ) d

dw

wF

=Iuv

( )( )( )

( )( )

( )cos

cos cos

d d

dA dA

d d

dA d dA

w ww

w q

w

q w q

= =×

F= =

× × ×

I IL

n

IL

uv uvuv

uv v

uv

wuv

nv

dw

( )dA nv

( )dA wuv

q

( )

( )

( )

( )

2

flux, radiated power W

irradiance, incident power on a surface W m

sr Steradian, unit solid angle (a full sphere is 4 sr)

radiant intensity given off by a point light source W sr

radiant intens

p

w

F =

=

=

=

=

E

I

Iuv

( )

( )

( )( ) ( )

( )( )

2

2

2

ity in direction W sr

differential unit solid angle sr

differential unit area m

differential unit area oriented in direction m

radiance given off by a (projected) surface W sr m

r

d

dA

dA

w

w

w w

w

=

=

=

=

=

L

L

uv

uv uv

uv( )2adiance in direction W sr mw

uv

CS248 Lecture 12 Kurt Akeley, Fall 2007

Radiance is distance invariant

Sample color value is determined by radiance

Distance doesn’t matter

Intuitively doubling the distance Reduces the energy from a unit area by factor of 4

Increases the area “covered” by the sample by a factor of 4

Multi-sample antialiasing filters radiance values

Why does a fire feel warmer, but have the same radiance (apparent brightness), when you are closer to it?

CS248 Lecture 12 Kurt Akeley, Fall 2007

Diffuse reflection

Scatter proportion

Function of θr Invariant to θi

n

rq

( ) ( )cosr d rd k dAw q= × × ×I Euv

cosd rk q×

Goniometric diagram

(Lambertian scatter)

CS248 Lecture 12 Kurt Akeley, Fall 2007

Diffuse reflection

( ) 2id

dA rw

F ×= =

n lE I

uv

( ) ( )

( ) ( )

( ) ( ) ( )

( )

2

2

2

cos

cos

1cos

cos

r d r

id r

r id rr

id

d k dA

k dAr

k dAr dA

kr

w q

q w

w q wq

w

= × × ×

×= × × ×

×= × × × ×

×

æ ö×÷ç= × ×÷ç ÷çè ø

I E

n lI

n lL I

n lI

uv

uv

uv uv

uv

( )( )cos

r

r

r

d

dA

ww

q=

×

IL

uvuv

cancellation

prev. slide

CS248 Lecture 12 Kurt Akeley, Fall 2007

Lambertian radiance

n

rq

cosd rk q×

Lambertian scatter

n

rq

Goniometric diagram

(Lambertian scatter)

Lambertian Radiance

( )rwLuv

CS248 Lecture 12 Kurt Akeley, Fall 2007

The moon

CS248 Lecture 12 Kurt Akeley, Fall 2007

Isotropic scatter (dusty surface)

n

rq

Goniometric diagram

(Lambertian scatter)

Isotropic scatter Radiance

n

rq

( )rwLuv

CS248 Lecture 12 Kurt Akeley, Fall 2007

Retroreflection (2-D)

The moon is actually somewhat retroreflective

CS248 Lecture 12 Kurt Akeley, Fall 2007

BRDF

Relates

Incoming irradiance to

Outgoing radiance

Degrees of freedom

4 in general (anisotropic)

3 in isotropic case

Add one for spectral

( ) ( ), ; , , ,r i i r r r i r r if fq f q f q q ff= -Isotropic:

CS248 Lecture 12 Kurt Akeley, Fall 2007

Anisotropic

Texture filtering (2 lectures ago)

Surface characteristics

CS248 Lecture 12 Kurt Akeley, Fall 2007

BSSRDF

CS248 Lecture 12 Kurt Akeley, Fall 2007

How can you implement BRDFs?

CS248 Lecture 12 Kurt Akeley, Fall 2007

Texture mapping

Paints images onto triangles

Paints images onto points, lines, and other images

Ties the vertex and pixel pipelines together Rendered images can be used as textures

To modify the rendering of new images– That can be used as textures …

Implements general functions of one, two, or three parameters Specified as 1-D, 2-D, or 3-D tables (aka texture

images) With interpolated (aka filtered) lookup

Drives the hardware architecture of GPUs Multi-thread latency hiding “shader” programmability

Adds many capabilities to OpenGL Volume rendering Alternate color spaces Shadows …

CS248 Lecture 12 Kurt Akeley, Fall 2007

Shading vs. lighting

Lighting

Light transport

Interaction of light with surfaces

Shading

Interpolation of radiance values

Examples: Smooth shading (aka Gouraud Shading)

Flat shading (aka constant shading)

Shader

Program run per vertex/primitive/fragment

Really more of a “lighter” than a “shader”

CS248 Lecture 12 Kurt Akeley, Fall 2007

Summary

Diffuse lighting

Radiance specified by n•l

Cosine fall-off is due to irradiance, not scattering

Many factors are ignored (often even the r2 fall-off)

Bidirectional reflectance distribution function (BRDF)

Ratio of reflected radiance to incident irradiance

Integrate over all incident light to get reflected radiance

5 DOF including spectral information

3 DOF for isotropic, non-spectral

Texture mapping is a powerful, general-purpose mechanism

It’s not just painting pictures onto triangles!

CS248 Lecture 12 Kurt Akeley, Fall 2007

Assignments

Next lecture: Z-buffer

Reading assignment for Tuesday’s class

FvD 15.1 through 15.5

CS248 Lecture 12 Kurt Akeley, Fall 2007

End