Transcript
Page 1: Lights in the  Phong  Model

Lights in the Phong Model

𝐼=π‘˜π‘Ž πΏπ‘Ž+π‘˜π‘‘πΏπ‘‘ ( οΏ½Μ‚οΏ½ βˆ™ οΏ½Μ‚οΏ½ )+π‘˜π‘ πΏπ‘  (𝑉 βˆ™ οΏ½Μ‚οΏ½ )𝑛

2. What are these?

οΏ½Μ‚οΏ½οΏ½Μ‚οΏ½ οΏ½Μ‚οΏ½

1. How to compute these?

Page 2: Lights in the  Phong  Model

Light source direction: β€’ Look around you … β€’ The light in Seattle: Indirect– background, … ambient

β€’ Sun light: Direct, very far away– coming from a constant direction

(independent of where you are)β€’ Light bulb at home: Direct– closer, shines from a fixed point

β€’ Light from the projector/desk lamp– How would you describe this?

credit: http://mynasadata.larc.nasa.gov/Radiation_Explanation.html

credit: http://www.truebeyonddesign.com/products-page/

http://www.apartmenttherapy.com/ny/lighting/best-product-tolomeo-desk-lamp-001066

Page 3: Lights in the  Phong  Model

What is Ambient Light?

β€’ Not in the real world!β€’ Implementation dependent!– constant color added to illumination results– Maya scene file

Ambient lightMaterial Property

Rendered image

Page 4: Lights in the  Phong  Model

What about the Sun?

β€’ How would you describe the incoming light source for this scene?

http://www.planetware.com/picture/kansas-cottonwood-falls-tallgrass-prairie-national-preserve-flint-hills-national-prairie-us-ks108.htm

Page 5: Lights in the  Phong  Model

Directional Lightβ€’ Direction is: β€’ No position!! (where is the Sun?)β€’ Light has no geometry and does not show up

in final rendered imageβ€’ Planes looks … flat β€’ Maya Scene

βˆ’ οΏ½Μ‚οΏ½

Directional Light

Rendered image

Page 6: Lights in the  Phong  Model

What about the Light Bulb?

β€’ How would you describe the light source of these scenes?

http://home.cogeco.ca/~richardastro2/

http://companyofburninghearts.wordpress.com/2010/03/18/mystic-clusters/

Page 7: Lights in the  Phong  Model

Point Lightβ€’ Position ()β€’ For every visible position ()

β€’ is unique!

β€’ Illumination is a function of relative position to lights!

β€’ Maya Scene

Different vector for each visible point

Rendered imagePoint Lights

Page 8: Lights in the  Phong  Model

Now, my desk lamp

http://0.tqn.com/d/drawsketch/1/0/N/J/eggsetup.jpg

http://www.mackayphotography.co.uk/light_pollution.htm

β€’ How would you describe the light source of these scenes?

http://agreenliving.org/tag/concept-design/

http://www.how-to-refinish-hardwood-floors.wirze.com/

Page 9: Lights in the  Phong  Model

Spot Lightβ€’ Direction + Position:– Pointing direction

– As in point light, for each visible point is unique!

– Cone angle (ΞΈ) defines illumination range

𝑃 𝐿

Different vector for each visible point

βˆ’ οΏ½Μ‚οΏ½ΞΈ

Page 10: Lights in the  Phong  Model

Rendered image

Maya Scene

Cone boundaries

Page 11: Lights in the  Phong  Model

Spotlight bounds– Position: – Main direction– : cone angle– ΞΈ: regions of full

illumination – angle to position

for illumination– If ΞΈ< < Illumination drops off according to:

ΞΈπ‹βˆ’ οΏ½Μ‚οΏ½

𝑃 𝐿

Region: fully illuminated

Penumbra Region: gradual drop off

𝛂 Illumination at this point is

𝐼 𝑓=[ cosπ›Όβˆ’ cos πœ‘2cos πœƒ2βˆ’ cos πœ‘

2]𝑝

Page 12: Lights in the  Phong  Model

Drop off behavior

𝐼 𝑓=[ cosπ›Όβˆ’ cos πœ‘2cos πœƒ2βˆ’ cos πœ‘

2]𝑝

Drop off p=1

p=0.2

p=0.1

p=30p=20

P>1

P<1

Page 13: Lights in the  Phong  Model

scene

No drop off

Penumbra region

Page 14: Lights in the  Phong  Model

Implement Penumbra Region

β€’ For a visible position:

β€’ cos(

If (cos( > cos( // < Full illumination

else if (cos() < cos()) // > no illuminationelse Penumbra region

ΞΈπ‹βˆ’ οΏ½Μ‚οΏ½

𝛂𝑃 𝐿

A visibleposition

Page 15: Lights in the  Phong  Model

Distance Attenuationβ€’ Illumination is a function of

β€’ d = distance between light and visible position!!

β€’ Physics tells us β€’ Did not follow physics in the rest of the

model!– WAY too dark!!

β€’ Generally:

d

𝐼=𝐼𝐿

𝐢0❑+𝐢1

❑𝑑+𝐢2❑𝑑2+𝐢3

❑𝑑3

Page 16: Lights in the  Phong  Model

How about ?

β€’ Let user specify each of thecomponents!

Maya:

OpenGL:

Our ToyRayTracer:

Page 17: Lights in the  Phong  Model

General form of Phone

𝐼= βˆ‘π‘–

𝐴𝑙𝑙 h𝐿𝑖𝑔 𝑑𝑠

π‘˜π‘ŽπΏπ‘Žπ‘–+𝐿𝑑 𝑖

𝐢0❑+𝐢1

❑𝑑+𝐢2❑𝑑2+𝐢3

❑𝑑3π‘˜π‘‘

( οΏ½Μ‚οΏ½ βˆ™πΏπ‘–)+𝐿𝑠𝑖

𝐢0❑+𝐢1

❑𝑑+𝐢2❑𝑑2+𝐢3

❑𝑑3π‘˜π‘  (𝑉 βˆ™π‘…π‘– )

𝑛

Our Ray Tracer implements:

𝐼=π‘˜π‘Ž+ βˆ‘π‘–

𝐴𝑙𝑙 h𝐿𝑖𝑔 𝑑𝑠

𝐿𝑑𝑖 [π‘˜π‘‘ ( οΏ½Μ‚οΏ½ βˆ™πΏπ‘–)+π‘˜π‘  (𝑉 βˆ™π‘…π‘– )𝑛 ]


Top Related