Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Computer Graphics CS 445 / 645 Lecture 12 Chapter 12: Color.

Similar presentations


Presentation on theme: "Introduction to Computer Graphics CS 445 / 645 Lecture 12 Chapter 12: Color."— Presentation transcript:

1 Introduction to Computer Graphics CS 445 / 645 Lecture 12 Chapter 12: Color

2 Test Sections from Hearn and Baker All of Ch. 2 except sections: 5, 6, and 7All of Ch. 2 except sections: 5, 6, and 7 All of Ch. 3 except sections: 10, 11, 12, 13, 14, 16, 17  endAll of Ch. 3 except sections: 10, 11, 12, 13, 14, 16, 17  end Ch. 4-10Ch. 4-10 All of Ch. 5All of Ch. 5 All of Ch. 6 except sections: 9 and 10All of Ch. 6 except sections: 9 and 10 All of Ch. 7 except sections: 11 and 12All of Ch. 7 except sections: 11 and 12 Appendix sections A-1, A-2, A-5, and A-7Appendix sections A-1, A-2, A-5, and A-7 Sections from Hearn and Baker All of Ch. 2 except sections: 5, 6, and 7All of Ch. 2 except sections: 5, 6, and 7 All of Ch. 3 except sections: 10, 11, 12, 13, 14, 16, 17  endAll of Ch. 3 except sections: 10, 11, 12, 13, 14, 16, 17  end Ch. 4-10Ch. 4-10 All of Ch. 5All of Ch. 5 All of Ch. 6 except sections: 9 and 10All of Ch. 6 except sections: 9 and 10 All of Ch. 7 except sections: 11 and 12All of Ch. 7 except sections: 11 and 12 Appendix sections A-1, A-2, A-5, and A-7Appendix sections A-1, A-2, A-5, and A-7

3 Homework Questions to help get ready for testQuestions to help get ready for test Will be graded for effortWill be graded for effort Download from class websiteDownload from class website Work individuallyWork individually Use of the web is allowedUse of the web is allowed Questions to help get ready for testQuestions to help get ready for test Will be graded for effortWill be graded for effort Download from class websiteDownload from class website Work individuallyWork individually Use of the web is allowedUse of the web is allowed

4 Canonical View Volume A standardized viewing volume representation Parallel (Orthogonal) Perspective Parallel (Orthogonal) Perspective A standardized viewing volume representation Parallel (Orthogonal) Perspective Parallel (Orthogonal) Perspective x or y -z x or y -z 1 Front Plane Back Plane x or y = +/- z

5 Why do we care? Canonical View Volume Permits Standardization ClippingClipping –Easier to determine if an arbitrary point is enclosed in volume –Consider clipping to six arbitrary planes of a viewing volume versus canonical view volume RenderingRendering –Projection and rasterization algorithms can be reused Canonical View Volume Permits Standardization ClippingClipping –Easier to determine if an arbitrary point is enclosed in volume –Consider clipping to six arbitrary planes of a viewing volume versus canonical view volume RenderingRendering –Projection and rasterization algorithms can be reused

6 Projection Normalization One additional step of standardization Convert perspective view volume to orthogonal view volume to further standardize camera representationConvert perspective view volume to orthogonal view volume to further standardize camera representation –Convert all projections into orthogonal projections by distorting points in three space (actually four space because we include homogeneous coordinate w)  Distort objects using transformation matrix One additional step of standardization Convert perspective view volume to orthogonal view volume to further standardize camera representationConvert perspective view volume to orthogonal view volume to further standardize camera representation –Convert all projections into orthogonal projections by distorting points in three space (actually four space because we include homogeneous coordinate w)  Distort objects using transformation matrix

7 Projection Normalization Building a transformation matrix How do we build a matrix thatHow do we build a matrix that –Warps any view volume to canonical orthographic view volume –Permits rendering with orthographic camera Building a transformation matrix How do we build a matrix thatHow do we build a matrix that –Warps any view volume to canonical orthographic view volume –Permits rendering with orthographic camera All scenes rendered with orthographic camera

8 Projection Normalization - Ortho Normalizing Orthographic Cameras Not all orthographic cameras define viewing volumes of right size and location (canonical view volume)Not all orthographic cameras define viewing volumes of right size and location (canonical view volume) Transformation must map:Transformation must map: Normalizing Orthographic Cameras Not all orthographic cameras define viewing volumes of right size and location (canonical view volume)Not all orthographic cameras define viewing volumes of right size and location (canonical view volume) Transformation must map:Transformation must map:

9 Projection Normalization - Ortho Two steps Translate center to (0, 0, 0)Translate center to (0, 0, 0) –Move x by –(x max + x min ) / 2 Scale volume to cube with sides = 2Scale volume to cube with sides = 2 –Scale x by 2/(x max – x min ) Compose these transformation matricesCompose these transformation matrices –Resulting matrix maps orthogonal volume to canonical Two steps Translate center to (0, 0, 0)Translate center to (0, 0, 0) –Move x by –(x max + x min ) / 2 Scale volume to cube with sides = 2Scale volume to cube with sides = 2 –Scale x by 2/(x max – x min ) Compose these transformation matricesCompose these transformation matrices –Resulting matrix maps orthogonal volume to canonical

10 Projection Normalization - Persp Perspective Normalization is Trickier

11 Perspective Normalization Consider N= After multiplying: p’ = Npp’ = Np Consider N= After multiplying: p’ = Npp’ = Np

12 Perspective Normalization After dividing by w’, p’ -> p’’

13 Perspective Normalization Quick Check If x = zIf x = z –x’’ = -1 If x = -zIf x = -z –x’’ = 1 If x = zIf x = z –x’’ = -1 If x = -zIf x = -z –x’’ = 1

14 Perspective Normalization What about z? if z = z maxif z = z max if z = z minif z = z min Solve for  and  such that zmin  -1 and zmax  1Solve for  and  such that zmin  -1 and zmax  1 Resulting z’’ is nonlinear, but preserves ordering of pointsResulting z’’ is nonlinear, but preserves ordering of points –If z 1 < z 2 … z’’ 1 < z’’ 2 What about z? if z = z maxif z = z max if z = z minif z = z min Solve for  and  such that zmin  -1 and zmax  1Solve for  and  such that zmin  -1 and zmax  1 Resulting z’’ is nonlinear, but preserves ordering of pointsResulting z’’ is nonlinear, but preserves ordering of points –If z 1 < z 2 … z’’ 1 < z’’ 2

15 Perspective Normalization We did it. Using matrix, N Perspective viewing frustum transformed to cubePerspective viewing frustum transformed to cube Orthographic rendering of cube produces same image as perspective rendering of original frustumOrthographic rendering of cube produces same image as perspective rendering of original frustum We did it. Using matrix, N Perspective viewing frustum transformed to cubePerspective viewing frustum transformed to cube Orthographic rendering of cube produces same image as perspective rendering of original frustumOrthographic rendering of cube produces same image as perspective rendering of original frustum

16 Color Next topic: Color To understand how to make realistic images, we need a basic understanding of the physics and physiology of vision. Here we step away from the code and math for a bit to talk about basic principles. Next topic: Color To understand how to make realistic images, we need a basic understanding of the physics and physiology of vision. Here we step away from the code and math for a bit to talk about basic principles.

17 Basics Of Color Elements of color:

18 Basics of Color Physics: IlluminationIllumination –Electromagnetic spectra ReflectionReflection –Material properties –Surface geometry and microgeometry (i.e., polished versus matte versus brushed) Perception Physiology and neurophysiologyPhysiology and neurophysiology Perceptual psychologyPerceptual psychologyPhysics: IlluminationIllumination –Electromagnetic spectra ReflectionReflection –Material properties –Surface geometry and microgeometry (i.e., polished versus matte versus brushed) Perception Physiology and neurophysiologyPhysiology and neurophysiology Perceptual psychologyPerceptual psychology

19 Physiology of Vision The eye: The retina RodsRods ConesCones –Color! The eye: The retina RodsRods ConesCones –Color!

20 Physiology of Vision The center of the retina is a densely packed region called the fovea. Cones much denser here than the peripheryCones much denser here than the periphery The center of the retina is a densely packed region called the fovea. Cones much denser here than the peripheryCones much denser here than the periphery

21 Physiology of Vision: Cones Three types of cones: L or R, most sensitive to red light (610 nm)L or R, most sensitive to red light (610 nm) M or G, most sensitive to green light (560 nm)M or G, most sensitive to green light (560 nm) S or B, most sensitive to blue light (430 nm)S or B, most sensitive to blue light (430 nm) Color blindness results from missing cone type(s)Color blindness results from missing cone type(s) Three types of cones: L or R, most sensitive to red light (610 nm)L or R, most sensitive to red light (610 nm) M or G, most sensitive to green light (560 nm)M or G, most sensitive to green light (560 nm) S or B, most sensitive to blue light (430 nm)S or B, most sensitive to blue light (430 nm) Color blindness results from missing cone type(s)Color blindness results from missing cone type(s)

22 Physiology of Vision: The Retina Strangely, rods and cones are at the back of the retina, behind a mostly-transparent neural structure that collects their response. http://www.trueorigin.org/retina.asp http://www.trueorigin.org/retina.asp

23 Perception: 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

24 Perception: Other Gotchas Color perception is also difficult because: It varies from person to personIt varies from person to person It is affected by adaptation (stare at a light bulb… don’t)It is affected by adaptation (stare at a light bulb… don’t) It is affected by surrounding color:It is affected by surrounding color: Color perception is also difficult because: It varies from person to personIt varies from person to person It is affected by adaptation (stare at a light bulb… don’t)It is affected by adaptation (stare at a light bulb… don’t) It is affected by surrounding color:It is affected by surrounding color:

25 Perception: Relative Intensity We are not good at judging absolute intensity Let’s illuminate pixels with white light on scale of 0 - 1.0 Intensity difference of neighboring colored rectangles with intensities:  0.10 -> 0.11 (10% change)  0.50 -> 0.55 (10% change) will look the same We perceive relative intensities, not absolute We are not good at judging absolute intensity Let’s illuminate pixels with white light on scale of 0 - 1.0 Intensity difference of neighboring colored rectangles with intensities:  0.10 -> 0.11 (10% change)  0.50 -> 0.55 (10% change) will look the same We perceive relative intensities, not absolute

26 Representing Intensities Remaining in the world of black and white… Use photometer to obtain min and max brightness of monitor This is the dynamic range Intensity ranges from min, I 0, to max, 1.0 How do we represent 256 shades of gray? Remaining in the world of black and white… Use photometer to obtain min and max brightness of monitor This is the dynamic range Intensity ranges from min, I 0, to max, 1.0 How do we represent 256 shades of gray?

27 Representing Intensities Equal distribution between min and max fails relative change near max is much smaller than near I 0relative change near max is much smaller than near I 0 Ex: ¼, ½, ¾, 1Ex: ¼, ½, ¾, 1 Preserve % change Ex: 1/8, ¼, ½, 1Ex: 1/8, ¼, ½, 1 I n = I 0 * r n I 0, n > 0I n = I 0 * r n I 0, n > 0 Equal distribution between min and max fails relative change near max is much smaller than near I 0relative change near max is much smaller than near I 0 Ex: ¼, ½, ¾, 1Ex: ¼, ½, ¾, 1 Preserve % change Ex: 1/8, ¼, ½, 1Ex: 1/8, ¼, ½, 1 I n = I 0 * r n I 0, n > 0I n = I 0 * r n I 0, n > 0 I 0 =I 0 I 1 = rI 0 I 2 = rI 1 = r 2 I 0 … I 255 =rI 254 =r 255 I 0

28 Dynamic Ranges Dynamic RangeMax # of Display(max / min illum)Perceived Intensities (r=1.01) Dynamic RangeMax # of Display(max / min illum)Perceived Intensities (r=1.01) CRT:50-200400-530 Photo (print)100465 Photo (slide)1000700 B/W printout100465 Color printout50400 Newspaper10234 Dynamic RangeMax # of Display(max / min illum)Perceived Intensities (r=1.01) Dynamic RangeMax # of Display(max / min illum)Perceived Intensities (r=1.01) CRT:50-200400-530 Photo (print)100465 Photo (slide)1000700 B/W printout100465 Color printout50400 Newspaper10234

29 Gamma Correction But most display devices are inherently nonlinear: Intensity = k(voltage)  i.e., brightness * voltage != (2*brightness) * (voltage/2)i.e., brightness * voltage != (2*brightness) * (voltage/2)  is between 2.2 and 2.5 on most monitors Common solution: gamma correction Post-transformation on intensities to map them to linear range on display device:Post-transformation on intensities to map them to linear range on display device: Can have separate  for R, G, BCan have separate  for R, G, B But most display devices are inherently nonlinear: Intensity = k(voltage)  i.e., brightness * voltage != (2*brightness) * (voltage/2)i.e., brightness * voltage != (2*brightness) * (voltage/2)  is between 2.2 and 2.5 on most monitors Common solution: gamma correction Post-transformation on intensities to map them to linear range on display device:Post-transformation on intensities to map them to linear range on display device: Can have separate  for R, G, BCan have separate  for R, G, B

30 Gamma Correction Some monitors perform the gamma correction in hardware (SGIs) Others do not (most PCs) Tough to generate images that look good on both platforms (i.e. images from web pages) Some monitors perform the gamma correction in hardware (SGIs) Others do not (most PCs) Tough to generate images that look good on both platforms (i.e. images from web pages)

31 Paul Debevec Top Gun Speaker Wednesday, October 9 th at 3:30 – OLS 011 http://www.debevec.org MIT Technolgy Review’s “100 Young Innovators” Top Gun Speaker Wednesday, October 9 th at 3:30 – OLS 011 http://www.debevec.org MIT Technolgy Review’s “100 Young Innovators”

32 Rendering with Natural Light

33 Fiat Lux

34 Light Stage


Download ppt "Introduction to Computer Graphics CS 445 / 645 Lecture 12 Chapter 12: Color."

Similar presentations


Ads by Google