Specular Reflection CS418 Computer Graphics John C. Hart
Diffuse Reflection diffuse reflection
Specular Reflection diffuse reflection diffuse + specular reflection
Specular Reflection n v l θ θ Specular gleem is a diffused mirror reflection of the light source
Specular Reflection n r l θ θ φ v Specular gleem is a diffused mirror reflection of the light source Gleem falls off as eye moves away from mirror-bounce reflection direction
Specular Reflection (Phong) n r l θ θ φ v L o = L i k s cos n φ % of light reflected (rest is absorbed)
Specular Reflection (Phong) n r l θ θ φ v L o = L i k s cos n φ = L i k s ( v ⋅ r ) n
Specular Reflection (Phong) n n r l r l θ θ φ v n ⋅ l θ L o = L i k s cos n φ = L i k s ( v ⋅ r ) n
Specular Reflection (Phong) n n r l r s l θ θ φ v n ⋅ l θ L o = L i k s cos n φ s = ( n ⋅ l ) n – l = L i k s ( v ⋅ r ) n
Specular Reflection (Phong) n n r l r s l θ θ φ v n ⋅ l θ L o = L i k s cos n φ s = ( n ⋅ l ) n – l = L i k s ( v ⋅ r ) n r = l + 2 s
Specular Reflection (Phong) n n r l r s l θ θ φ v n ⋅ l θ L o = L i k s cos n φ s = ( n ⋅ l ) n – l = L i k s ( v ⋅ r ) n r = l + 2 s = l + 2( n ⋅ l ) n – 2 l = 2( n ⋅ l ) n – l
Specular Reflection (Blinn) n h l φ θ θ v h = ( l + v )/|| l + v || L o = L i k s cos n φ = L i k s ( n ⋅ h ) n
Specular Reflection (Blinn) (Phong) n n r h l l φ θ θ θ φ θ v v r = 2( n ⋅ l ) n – l h = ( l + v )/|| l + v || L o = L i k s cos n φ L o = L i k s cos n φ = L i k s ( n ⋅ h ) n = L i k s ( v ⋅ r ) n
The Phong Lighting Model • Monochromatic L o = k a L a + L i ( k d n ⋅ l + k s ( v ⋅ r ) n ) = + +
The Phong Lighting Model • Monochromatic L o = k a L a + L i ( k d n ⋅ l + k s ( v ⋅ r ) n ) • Tristimulus (RGB) color model L o(R) = k a(R) L a(R) + L i(R) ( k d(R) n ⋅ l + k s(R) ( v ⋅ r ) n ) L o(G) = k a(G) L a(G) + L i(G) ( k d(G) n ⋅ l + k s(G) ( v ⋅ r ) n ) L o(B) = k a(B) L a(B) + L i(B) ( k d(B) n ⋅ l + k s(B) ( v ⋅ r ) n ) + + =
The Phong Lighting Model • Monochromatic L o = k a L a + L i ( k d n ⋅ l + k s ( v ⋅ r ) n ) • Tristimulus (RGB) color model L o(R) = k a(R) L a(R) + L i(R) ( k d(R) n ⋅ l + k s(R) ( v ⋅ r ) n ) L o(G) = k a(G) L a(G) + L i(G) ( k d(G) n ⋅ l + k s(G) ( v ⋅ r ) n ) L o(B) = k a(B) L a(B) + L i(B) ( k d(B) n ⋅ l + k s(B) ( v ⋅ r ) n ) • Multiple light sources L o = k a L a + L i(1) ( k d n ⋅ l (1) + k s ( v ⋅ r (1) ) n ) + L i(2) ( k d n ⋅ l (2) + k s ( v ⋅ r (2) ) n ) + … = +
Attenuation • Local Illumination L o = k a L a + L i ( k d n ⋅ l + k s ( v ⋅ r ) n ) lp n l e v L i x 2 L o x x 1 x 0
Attenuation • Local Illumination L o = k a L a + L i ( k d n ⋅ l + k s ( v ⋅ r ) n ) • Global Illumination L i = F att (|| x - e ||) L s L e = F att (|| x - e ||) L o lp e L s L e L i L o x
Attenuation • Local Illumination L o = k a L a + L i ( k d n ⋅ l + k s ( v ⋅ r ) n ) Physical: F att ( d ) = 1/ d 2 • Global Illumination Plausible: F att ( d ) = 1/( F 0 + F 1 d + F 2 d 2 ) L i = F att (|| x - e ||) L s L e = F att (|| x - e ||) L o lp e L s L e L i L o x Sphere Area = 4 π r 2
Recommend
More recommend