CS488 Shading and Illumination
Luc RENAMBOT
CS488 Shading and Illumination Luc R ENAMBOT Introduction Through - - PowerPoint PPT Presentation
CS488 Shading and Illumination Luc R ENAMBOT Introduction Through the first half of the class, polygons were represented by the line segments connecting their vertices, or by filling them with a solid color. This is not very realistic
Luc RENAMBOT
2
VERY long time.
produce appropriate results, but they do not work in the same way reality works - because that would take too long to compute, at least for interactive graphics
will instead specify the properties of the material that the polygon is supposed to be made out of, and the properties of the light or lights shining onto that material.
3
give off light)
its surface
4
5
appears to come equally from all directions
world
6
light in all directions. Polygons, and parts of polygons which are closer to the light appear brighter than those that are further away
all of the light rays emanating from the light strike the polygons in the scene from a single direction
more light in the center of the cone, gradually tapering off towards the sides of the cone
7
8
9
10
11
12
surface normal (N) and the direction to the light source (L)
13
14
15
16
17
18
19
20
21
22
23
24
25
26
surface of the polygon
light it is hit with, and absorbs all of the blue and green
appear black (as those lights have no red component.)
red (as the polygon will reflect the red component of the light)
27
28
slowly transition to the fog color towards the ending distance.
29
30
31
32
33
34
35
36
37
38
39
40
41
Ia = (Ys - Y2) / (Y1 - Y2) * I1 + (Y1 - Ys) / (Y1 - Y2) * I2 Ib = (Ys - Y3) / (Y1 - Y3) * I1 + (Y1 - Ys) / (Y1 - Y3) * I3 Ip = (Xb - Xp) / (Xb - Xa) * Ia + (Xp - Xa) / (Xb - Xa) * Ib
point.
scene looking at sharp edges
from the mathematical edge to a discrete set of pixels. We saw near the beginning of the course how to scan convert a line into the frame buffer, but at that point we only deal with placing the pixel or not placing the pixel.
42
boundaries - some pixels will be mostly covered by the line (or edge), and others only slightly. Instead of making a yes/ no decision we can assign a value to this coverage (from say 0 to 1) for each pixel and then use these values to blend the colour of the line (or edge) with the existing contents
GL_POINT_SMOOTH_HINT, GL_LINE_SMOOTH_HINT, GL_POLYGON_SMOOTH_HINT
43
44
45
46
47
48
49
50