Download presentation
Presentation is loading. Please wait.
1
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실
2
Shading Compute the radiance for each object
Figure out which pixels to fill Determine a color for each filled pixel
3
Illumination Components
Emission at light sources Scattering at surfaces Wireframe Without Illumination With Illumination
4
Light Source Model Simple mathematical models Point light
Directional light Spot light
5
Point Light Source Omni-directional point source, ex) bulb
Intensity (I) Position (px, py, pz)
6
Directional Light Source
Point light source at infinity, ex) sun Intensity (I) Direction (dx,dy,dz)
7
Spot Light Source Point light source with direction, ex) Luxo
Intensity (I), Position (px, py, pz) Direction (dx, dy, dz)
8
Light Intensity Function
IE: emitted intensity for light sources KA, KD, Ks Ambient / diffuse / specular reflection coefficient IAL: ambient light intensity N: unit normal vector L Unit direction vector to the point light source from a position on the surface IL: the intensity of the point light source V: unit viewing direction vector R: specular reflection vector
9
Reflectance Model Simple analytic model Diffuse reflection
Specular reflection Emission Ambient
10
Diffuse Reflection Surface reflects equally in all directions
With equal intensity
11
Diffuse Reflection How much light is reflected? N L
Depends on angle of incident light dL = dA cos = N L Maximum at the head-on light ( = 0) N L
12
Specular Reflection Strongest reflection near the mirror angle
Examples: mirrors, metals
13
Specular Reflection How much light is reflected? Depends on
Angle of incident light Angle to viewer
14
Ks: Specular Reflectance Factor
Specular Reflection Phong model {cos(a)}n = (VR)n n: exponent Ks: Specular Reflectance Factor
15
Effects of Exponent Ambient Exponent(n)
16
Emission Light emitting directly from surfaces ex) light source
17
Ambient Term Compensated reflection of indirect illumination
18
Reflectance Model Simple analytic model Diffuse reflection
Specular reflection Emission Ambient
19
Reflectance Model Simple analytic model Diffuse reflection
Specular reflection Emission Ambient Affected by the position of the light source Not affected by the position of the light source
20
Ambient and Diffuse Ambient Diffuse
21
Surface Illumination Calculation
Single light source
22
Surface Illumination Calculation
Multiple light sources Not Affected
23
Shadows Which light sources are blocked
Cast ray towards each light source Li Si = 0 if ray is blocked, Si = 1 otherwise Shadow Term
24
Transparency Alpha value Back to front
How much light can be transmitted? Back to front
25
Polygon Shading Spatial coherence
Illumination calculations for pixels covered by the same primitive
26
Flat Shading Constant-intensity shading OK for polyhedral objects
Not so good for ones with smooth surfaces
27
Flat Shading Process One illumination calculation per polygon
Assign all pixels inside each polygon the same color Polygon Normal Vector
28
<Gouraud Shading>
Intensity-interpolation scheme Produces smoothly shaded polygonal mesh Piecewise linear approximation To capture subtle lighting effects Needs fine mesh Phong shading solves it <Flat Shading> <Gouraud Shading>
29
Mesh with Shared Normals at Vertices
Gouraud Shading Polygonal mesh with the vertex normal vectors Smooth shading over adjacent polygons Curved surfaces Illumination highlights Soft shadows Mesh with Shared Normals at Vertices
30
Gouraud Shading Process (1/2)
One lighting calculation per vertex Assign pixels inside polygon By interpolating colors computed at vertices N1 Viewer L1 Light V1 N2 N3 Polygon Vertex Normal Vector
31
Gouraud Shading Process (2/2)
Bilinearly interpolate colors at vertices Down and across scan lines I1 I I2 I3
32
Vertex Normal Vector Average of the surface normals
For each polygon sharing that vertex N2 N1 N3 N4
33
Phong Shading Normal-vector interpolation shading
Subtle illumination effects in polygon interiors
34
Phong Shading Process (1/2)
One lighting calculation per pixel Approximate surface normals for inside points N1 Viewer L1 Light V1 N2 N3 Polygon
35
Phong Shading Process (2/2)
Bilinearly interpolate surface normals at vertices Down and across scan lines N1 N α β γ N2 N3
36
Various Shading Results
<Wireframe> <Flat> <Gouraud> <Phong>
37
Ray Casting & Tracing Independent lighting calculation for every pixel
38
Ray Casting & Tracing
39
Ray Casting Find surface intersection point Visible surface detection
Ray from eye to the screen pixel No reflection or refraction Direct illumination Visible surface detection Shadow calculation
40
Ray Tracing Recursive ray casting
Inter-object light reflection effects Global (mutual) illumination For global reflection and transmission Highly realistic quality vs. computation time Overview Bounce (reflect) or refract the ray Collecting its intensity At each reflection point
41
Ray Tracing Example <Reflection and refraction ray paths through a scene for a screen pixel>
42
<Ray Tracing Tree>
Left branch: reflection Right branch: transmission (refraction) Terminate when Reaches the defined maximum depth Strikes the light sources Accumulate the intensity From the bottom to top <Ray Tracing Tree>
43
Summary Polygon shading Ray casting Ray tracing Radiosity Flat shading
Gouraud shading Phong shading Ray casting Ray tracing Recursive ray casting Inter-object reflection (global illumination) Highly realistic quality vs. computation time Radiosity Supported by OpenGL
44
For Implementation
45
Intensity Calculation
For general object, IE = 0 IAL ≠ IE Intensity calculation for RGB channel (IR, IG, IB) KAR, KDR, KSR, KAG, KDG, KSG, KAB, KDB, KSB
46
Shading Function Example
IE = 0, KA = 0.2, KD = 0.4, KS = 0.1, IAL = 0.3, I0 = 0.8, n = 32 N1 N2 N3
47
Scan-line Shading Example
2 1.5 2 1 N2 1 1 N3 P2 P3
48
Flat Shading Example N1 P1 N N2 N3 P2 P3
49
Gouraud Shading Example
I4=(I1*1+I2*2)/3 2 I5=(I1*1+I3*1.5)/2.5 1.5 2 1 N2 1 I=(I4*1+I5*2)/3 1 N3 P2 P3 I3 I2
50
2 1.5 2 1 1 N=(N4*1+N5*2)/3 1 Phong Shading Example N1 P1 N2 N3 P2 P3
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.