Download - Lights in the Phong Model
Lights in the Phong Model
πΌ=ππ πΏπ+πππΏπ ( οΏ½ΜοΏ½ β οΏ½ΜοΏ½ )+ππ πΏπ (π β οΏ½ΜοΏ½ )π
2. What are these?
οΏ½ΜοΏ½οΏ½ΜοΏ½ οΏ½ΜοΏ½
1. How to compute these?
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
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
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
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
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/
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
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/
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
β οΏ½ΜοΏ½ΞΈ
Rendered image
Maya Scene
Cone boundaries
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]π
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
scene
No drop off
Penumbra region
Implement Penumbra Region
β’ For a visible position:
β’ cos(
If (cos( > cos( // < Full illumination
else if (cos() < cos()) // > no illuminationelse Penumbra region
ΞΈπβ οΏ½ΜοΏ½
ππ πΏ
A visibleposition
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
How about ?
β’ Let user specify each of thecomponents!
Maya:
OpenGL:
Our ToyRayTracer:
General form of Phone
πΌ= βπ
π΄ππ hπΏππ π‘π
πππΏππ+πΏπ π
πΆ0β+πΆ1
βπ+πΆ2βπ2+πΆ3
βπ3ππ
( οΏ½ΜοΏ½ βπΏπ)+πΏπ π
πΆ0β+πΆ1
βπ+πΆ2βπ2+πΆ3
βπ3ππ (π βπ π )
π
Our Ray Tracer implements:
πΌ=ππ+ βπ
π΄ππ hπΏππ π‘π
πΏππ [ππ ( οΏ½ΜοΏ½ βπΏπ)+ππ (π βπ π )π ]