Download - Lights in the Phong Model
![Page 1: Lights in the Phong Model](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/1.jpg)
Lights in the Phong Model
๐ผ=๐๐ ๐ฟ๐+๐๐๐ฟ๐ ( ๏ฟฝฬ๏ฟฝ โ ๏ฟฝฬ๏ฟฝ )+๐๐ ๐ฟ๐ (๐ โ ๏ฟฝฬ๏ฟฝ )๐
2. What are these?
๏ฟฝฬ๏ฟฝ๏ฟฝฬ๏ฟฝ ๏ฟฝฬ๏ฟฝ
1. How to compute these?
![Page 2: Lights in the Phong Model](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/2.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/3.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/4.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/5.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/6.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/7.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/8.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/9.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/10.jpg)
Rendered image
Maya Scene
Cone boundaries
![Page 11: Lights in the Phong Model](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/11.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/12.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/13.jpg)
scene
No drop off
Penumbra region
![Page 14: Lights in the Phong Model](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/14.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/15.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/16.jpg)
How about ?
โข Let user specify each of thecomponents!
Maya:
OpenGL:
Our ToyRayTracer:
![Page 17: Lights in the Phong Model](https://reader036.vdocument.in/reader036/viewer/2022062323/5681610d550346895dd0632b/html5/thumbnails/17.jpg)
General form of Phong
๐ผ= โ๐
๐ด๐๐ h๐ฟ๐๐ ๐ก๐
๐๐๐ฟ๐๐+๐ฟ๐๐
๐ถ0โ+๐ถ1
โ๐+๐ถ2โ๐2+๐ถ3
โ๐3๐๐
( ๏ฟฝฬ๏ฟฝ โ๐ฟ๐)+๐ฟ๐ ๐
๐ถ0โ+๐ถ1
โ๐+๐ถ2โ๐2+๐ถ3
โ๐3๐๐ (๐ โ๐ ๐ )
๐
Our Ray Tracer implements:
๐ผ=๐๐+ โ๐
๐ด๐๐ h๐ฟ๐๐ ๐ก๐
๐ฟ๐๐ [๐๐ ( ๏ฟฝฬ๏ฟฝ โ๐ฟ๐)+๐๐ (๐ โ๐ ๐ )๐ ]