Presentation is loading. Please wait.

Presentation is loading. Please wait.

Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.

Similar presentations


Presentation on theme: "Illumination Model 고려대학교 컴퓨터 그래픽스 연구실."— Presentation transcript:

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 = (VR)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 Radiosity Goal Simulate diffuse inter-object reflections and shadows

44 Radiosity Basic Idea Treat every polygon as light source

45 Ray Tracing & Radiosity
Characteristics Radiosity is good at diffuse inter-object reflection Ray tracing is good at specular inter-object reflection  Combine both approaches for each component!!!

46 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


Download ppt "Illumination Model 고려대학교 컴퓨터 그래픽스 연구실."

Similar presentations


Ads by Google