Color Week 5, Fri Feb 4 http://www.ugrad.cs.ubc.ca/~cs314/Vjan2005 - - PowerPoint PPT Presentation

color week 5 fri feb 4
SMART_READER_LITE
LIVE PREVIEW

Color Week 5, Fri Feb 4 http://www.ugrad.cs.ubc.ca/~cs314/Vjan2005 - - PowerPoint PPT Presentation

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Color Week 5, Fri Feb 4 http://www.ugrad.cs.ubc.ca/~cs314/Vjan2005 Review: Shading Models flat shading compute Phong lighting once for entire


slide-1
SLIDE 1

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner http://www.ugrad.cs.ubc.ca/~cs314/Vjan2005

Color Week 5, Fri Feb 4

slide-2
SLIDE 2

2

Review: Shading Models

 flat shading

 compute Phong lighting once for entire

polygon

 Gouraud shading

 compute Phong lighting at the vertices and

interpolate lighting values across polygon

 Phong shading

 compute averaged vertex normals  interpolate normals across polygon and

perform Phong lighting across polygon

slide-3
SLIDE 3

3

Correction: Phong Shading

 linearly interpolating surface normal across the

facet, applying Phong lighting model at every pixel

 same input as Gouraud shading  pro: much smoother results  con: considerably more expensive

 not the same as Phong lighting

 common confusion  Phong lighting: empirical model to calculate

illumination at a point on a surface

slide-4
SLIDE 4

4

Review/Correction: Non-Photorealism

 draw silhouettes and creases  cool-to-warm shading

http://www.cs.utah.edu/~gooch/SIG98/paper/drawing.html (n0 ⋅ n1) ≤ threshold

slide-5
SLIDE 5

5

Computing Normals

 per-vertex normals by interpolating per-facet

normals

 OpenGL supports both

 computing normal for a polygon

c b a

slide-6
SLIDE 6

6

Computing Normals

 per-vertex normals by interpolating per-facet

normals

 OpenGL supports both

 computing normal for a polygon

 three points form two vectors

c b a b-c a-b

slide-7
SLIDE 7

7

Computing Normals

 per-vertex normals by interpolating per-facet

normals

 OpenGL supports both

 computing normal for a polygon

 three points form two vectors  cross: normal of plane

c b a b-c a-b (a-b) x (b-c)

slide-8
SLIDE 8

8

Computing Normals

 per-vertex normals by interpolating per-facet

normals

 OpenGL supports both

 computing normal for a polygon

 three points form two vectors  cross: normal of plane  which side of plane is up?

 counterclockwise

point order convention c b a b-c a-b (a-b) x (b-c)

slide-9
SLIDE 9

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner

Color

slide-10
SLIDE 10

10

Basics Of Color

 elements of color:

slide-11
SLIDE 11

11

Basics of Color

 Physics:

 Illumination

 Electromagnetic spectra

 Reflection

 Material properties  Surface geometry and microgeometry (i.e.,

polished versus matte versus brushed)

 Perception

 Physiology and neurophysiology  Perceptual psychology

slide-12
SLIDE 12

12

Electromagnetic Spectrum

slide-13
SLIDE 13

13

White Light

 Sun or light bulbs emit all frequencies within

the visible range to produce what we perceive as the "white light"

slide-14
SLIDE 14

14

Sunlight Spectrum

slide-15
SLIDE 15

15

White Light and Color

 when white light is incident upon an object,

some frequencies are reflected and some are absorbed by the object

 combination of frequencies present in the

reflected light that determinses what we perceive as the color of the object

slide-16
SLIDE 16

16

Hue

 hue (or simply, "color") is dominant wavelength

 integration of energy for all visible wavelengths is

proportional to intensity of color

slide-17
SLIDE 17

17

Saturation or Purity of Light

 how washed out or how pure the color of

the light appears

 contribution of dominant light vs. other

frequencies producing white light

slide-18
SLIDE 18

18

Intensity vs. Brightness

 intensity : radiant energy emitted per unit of

time, per unit solid angle, and per unit projected area of the source (related to the luminance of the source)

 brightness : perceived intensity of light

slide-19
SLIDE 19

19

Humans and Light

 when we view a source of light, our eyes respond

respond to

 hue: the color we see (red, green, purple)

 dominant frequency

 saturation: how far is color from grey

 (pink is less saturated than red, sky blue is less

saturated than royal blue)

 brightness: how bright is the color

 how close is the color to white or black  how bright are the lights illuminating the object?

slide-20
SLIDE 20

20

Physiology of Vision

 the eye:  the retina

 rods  cones

 color!

slide-21
SLIDE 21

21

Physiology of Vision

 center of retina is densely packed region

called the fovea.

 cones much denser here than the periphery

slide-22
SLIDE 22

22

Trichromacy

 three types of cones

 L or R, most sensitive to red light (610 nm)  M or G, most sensitive to green light (560 nm)  S or B, most sensitive to blue light (430 nm)  color blindness results from missing cone type(s)

slide-23
SLIDE 23

23

Metamers

 a given perceptual sensation of color derives

from the stimulus of all three cone types

 identical perceptions of color can thus be caused by

very different spectra

slide-24
SLIDE 24

24

Metamer Demo

http://www.cs.brown.edu/exploratories/freeSoftware/catalogs/color_theory.html

slide-25
SLIDE 25

25

Adaptation, Surrounding Color

 color perception is also affected by

 adaptation (move from sunlight to dark room)  surrounding color/intensity:

 simultaneous contrast effect

slide-26
SLIDE 26

26

Bezold Effect

 impact of outlines

slide-27
SLIDE 27

27

Color Constancy

slide-28
SLIDE 28

28

Color Constancy

slide-29
SLIDE 29

29

Color Constancy

slide-30
SLIDE 30

30

Color Constancy

slide-31
SLIDE 31

31

Color Constancy

slide-32
SLIDE 32

32

Color Constancy

slide-33
SLIDE 33

33

Color Constancy

 automatic “white

balance” from change in illumination

 vast amount of

processing behind the scenes!

 colorimetry vs.

perception

slide-34
SLIDE 34

34

Color Spaces

 three types of cones suggests

color is a 3D quantity. how to define 3D color space?

 idea: perceptually based measurement

 shine given wavelength (λ) on a screen  user must control three pure lights producing

three other wavelengths (say R=700nm, G=546nm, and B=436nm)

ν adjust intensity of RGB until colors are identical

 this works because of metamers!

slide-35
SLIDE 35

35

Negative Lobes

 exact target match with

phosphors not possible

 some red had to be added to target color to permit exact match

using “knobs” on RGB intensity output of CRT

 equivalently (theoretically), some red could have been

removed from CRT output

 figure shows that red phosphor must remove some cyan for

perfect match

 CRT phosphors cannot remove cyan, so 500 nm cannot be

generated

slide-36
SLIDE 36

36

Negative Lobes

 can’t generate all other wavelenths with any

set of three positive monochromatic lights!

 solution: convert to new synthetic coordinate

system to make the job easy

slide-37
SLIDE 37

37

CIE Color Space

 CIE defined three “imaginary” lights X, Y,

and Z, any wavelength λ can be matched perceptually by positive combinations

Note that: X ~ R Y ~ G Z ~ B

slide-38
SLIDE 38

38

Measured vs. CIE Color Spaces

measured basis

monochromatic lights

physical observations

negative lobes

 transformed basis

 “imaginary” lights  all positive, unit area  Y is luminance

slide-39
SLIDE 39

39

CIE Color Space Gamut

 the gamut of all colors perceivable is thus a three-

dimensional shape in X,Y,Z

 color = X’X + Y’Y + Z’Z

slide-40
SLIDE 40

40

RGB Color Space (Color Cube)

 define colors with (r, g, b)

amounts of red, green, and blue

 used by OpenGL

 RGB color cube sits within

CIE color space something like this

 subset of perceivable colors

slide-41
SLIDE 41

41

CIE Chromaticity Diagram (1931)

For simplicity, we

  • ften project to the

2D plane X’+Y’+Z’=1 X’ = X’ / (X’+Y’+Z’) Y’ = Y’ / (X’+Y’+Z’) Z’ = 1 – X’ – Y’

slide-42
SLIDE 42

42

Device Color Gamuts

 use CIE chromaticity diagram to compare

the gamuts of various devices

slide-43
SLIDE 43

43

Device Color Gamuts

 Since X, Y, and Z are hypothetical light

sources, no real device can produce the entire gamut of perceivable color

 Example: CRT monitor

slide-44
SLIDE 44

44

Gamut Mapping

slide-45
SLIDE 45

45

YIQ Color Space

 YIQ is the color model used for color TV

in America. Y is brightness, I & Q are color

 note: Y is the same as CIE’s Y  result: use the Y alone and backwards

compatibility with B/W TV!

slide-46
SLIDE 46

46

Converting Color Spaces

 converting between color models can

also be expressed as a matrix transform

 note the relative unimportance of blue in

computing the Y

                    − − − =           B G R Q I Y 31 . 52 . 21 . 32 . 28 . 60 . 11 . 59 . 30 .

slide-47
SLIDE 47

47

HSV Color Space

 a more intuitive color space

 H = Hue  S = Saturation  V = Value (or brightness)

Value Saturation Hue

slide-48
SLIDE 48

48

Simple Model of Color

 based on RGB triples  surface interactions also simplified

slide-49
SLIDE 49

49

slide-50
SLIDE 50

50

The Gamma Problem

 device gamma

 monitor: I= A(k1D+k2V)γ  typical monitor γ=2.5  LCD: nearly linear

 OS gamma

 defined by operating system  inverse gamma curve I1/γ  “gamma correction”

slide-51
SLIDE 51

51

Display System Gamma

 product of device and OS curves

 divide device by OS gamma

 γDS = γD (1/γOS)

 display system gamma varies

 different devices, different OS  nonlinear

 viewing conditions also affect

perception of “gamma”

1.7 1.4 1.0 SGI Mac PC Default OS Gamma 1.3 1.6 2.2 SGI Mac PC Default DS Gamma

slide-52
SLIDE 52

52

Intensity Mapping