of 69 /69
1 How do we draw a picture? Define geometry. Now what? We can draw the edges of the faces. Wireframe. We can only draw the edges of faces that are visible. We can fill in the faces. Giving each object a color (constant shading). COSC 342

others
• Category

Documents

• view

1

0

Embed Size (px)

Transcript of How do we draw a picture?sking/Courses/COSC5327/Notes/Shading2.pdf · • We can draw the edges of...

1

How do we draw a picture?

• Define geometry.

• Now what?

• We can draw the edges of the faces. Wireframe.

• We can only draw the edges of faces that are visible.

• We can fill in the faces. Giving each object a color(constant shading).

COSC 342

2

• Assumes the object is faceted, and light and viewerat infinity.

• Illumination model is applied only once per polygon.

2

• Assumes the object is faceted, and light and viewerat infinity.

• Illumination model is applied only once per polygon.

• What if the object represents a curved surface?

COSC 342

3

• Works poorly if the model represents a curved sur-face.

• Adding more facets helps but...

? Slows down the rendering.? Effectiveness is tempered by Mach banding.

COSC 342

4

Mach Bands

Perceived intensity change at edges are exageratedby receptors in our eyes, making the dark facet lookdarker and the light facet look lighter.

COSC 342

5

Is A or B darker?

illusion by Ted Adelson COSC 342

6

Are you sure?

illusion by Ted Adelson COSC 342

7

Is A or B darker?

illusion by Ted Adelson COSC 342

8

Are you sure?

illusion by Ted Adelson COSC 342

9

Are the diamonds the same colour?

illusion by Ted Adelson COSC 342

10

Are the diamonds the same colour?

illusion by Ted Adelson COSC 342

11

12

Are the circles the same colour and size?

13

Harmann-grid illusion - See white circles?

14

15

16

• Discontinuities eliminated by interpolating intensity.

• Almost removes Mach bands (high curvature can stillsuffer).

• Easily implemented in hardware.

17

• Illumination is calculated per vertex.

• Average normals of polygons that share vertex.

• Vertex colors linearly interpolated per pixel, firstalong the edges, then between those for the scan-line.

• Slower than flat shading, with much better results forcurved surfaces.

18

19

20

• Highlights are spread along edges.

• Highlights tend to be larger than they should.

• Highlights tend to be shaped funny (dependent onnumber of polys).

• Misses specular highlights contained within a poly-gon.

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

• Don’t confuse with Phong illumination(same guy different algorithm).

• Also called normal-vector interpolation shading.

• Interpolates the surface normals instead of the inten-sity values.

• Calculate illumination at every pixel, as well as a vec-tor normalization. Much slower than Gouraud.

• Gives better results, especially for highlights.

• Can handle highlights within a polygon.

37

38

Patrick Coleman

39

Patrick Coleman

40

from Watt, 1989

41

• Must store normals at each vertex.

• Silhouette edges not smoothed.

• Interpolation can mask regular changes.

• Interpolation in image space ignores perspective dis-tortion.

• Crease edges should not have smooth shading.

• Orientation dependence.

from Watt, 1989

42

from Watt, 1989

43

from Watt, 1989

44

from Watt, 1989

45

B

C

Dp

from Watt, 1989

46

A

B

C

D

p

from Watt, 1989

47

B

C

Dp

A

B

C

D

p

from Watt, 1989

48

• Use triangles.

• Use more triangles.

• Use multiple normals (to get sharp edges)

from Watt, 1989

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68