Lightning and Shading (Part-I)
Lightning and Shading (Part-I)
1
Objectives
2
Why we need shading
3
Shading
shadow
Point Source of
Light
multiple reflection
translucent surface
7
Local vs Global Rendering
8
Light-Material Interaction
illuminating function
I(x,y,z,θ,ϕ,λ)
10
Light Sources
11
Light Sources
• Point source
Model with position and color
Distant source = infinite distance away (parallel)
• Spotlight
Restrict light from ideal point source
narrow range of angles through which light is emitted
• Ambient light
Uniform lightning by large sources
Same amount of light everywhere in scene
Can model contribution of many sources and reflecting
surfaces
12
Light Sources
Distant Light
-Light source is far from the surface of the object, ex: Sun
-so, the intensity at every point on the object surface is same
13
Interaction b/w rays and object
14
Surface Types
15
Phong Lightning Model
• A simple model that can be computed rapidly
• supports three types of light-material interactions
Diffuse
Specular
Ambient
• Uses four vectors
Light source
To viewer
Normal
Perfect reflector
to define the color for point p
16
Ideal Reflector
r = 2 (l · n ) n - l
17
Ambient Reflection
Ia=ka.La I a
18
Diffuse Reflection
• Perfectly diffuse reflector
• Light scattered equally in all directions
• Amount of light reflected is proportional to the
vertical component of incoming light-
Lambert's law
reflected light ~cos i
cos i = l · n if vectors normalized
There are also three coefficients, kr, kb, kg that show
how much of each color component is reflected
19
Specular Reflections
specular
highlight
20
Modeling Specular Relections
Ir ~ ks I cos
reflected shininess coef
intensity incoming intensity
absorption coef
21
The Shininess Coefficient
cos
-90 90
22