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๐ฟ๐๐ ๐ก๐
๐ฟ๐๐ [๐๐ ( ๏ฟฝฬ๏ฟฝ โ๐ฟ๐)+๐๐ (๐ โ๐ ๐ )๐ ]
Top Related