lecture12-1

lecture12-1 - Introduction to Computer Graphics CS 445 /...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Introduction to Computer Graphics CS 445 / 645 Lecture 12 Chapter 12: Color Test Sections from Hearn and Baker • All of Ch. 2 except sections: 5, 6, and 7 • All of Ch. 3 except sections: 10, 11, 12, 13, 14, 16, 17end • Ch. 4-10 • All of Ch. 5 • All of Ch. 6 except sections: 9 and 10 • All of Ch. 7 except sections: 11 and 12 • Appendix sections A-1, A-2, A-5, and A-7 Homework • Questions to help get ready for test • Will be graded for effort • Download from class website • Work individually • Use of the web is allowed Canonical View Volume A standardized viewing volume representation Parallel (Orthogonal) Parallel x or y Front Plane -1 -1 x or y Back Plane 1 Perspective -z Front Plane x or y = +/- z Back Plane -z Why do we care? Canonical View Volume Permits Standardization • Clipping – Easier to determine if an arbitrary point is enclosed in Easier volume volume – Consider clipping to six arbitrary planes of a viewing Consider volume versus canonical view volume volume • Rendering – Projection and rasterization algorithms can be reused Projection Normalization One additional step of standardization • Convert perspective view volume to orthogonal view volume Convert to further standardize camera representation to – Convert all projections into orthogonal projections by Convert distorting points in three space (actually four space because we include homogeneous coordinate w) because Distort objects using transformation matrix Projection Normalization Building a transformation Building matrix matrix • How do we build a matrix that – Warps any view volume to Warps canonical orthographic view volume volume – Permits rendering with Permits orthographic camera orthographic All scenes rendered All with orthographic camera camera Projection Normalization - Ortho Normalizing Orthographic Cameras • Not all orthographic cameras define viewing volumes of right Not size and location (canonical view volume) size • Transformation must map: xmin ¡ ! ¡ xmax ¡ ! ymin ¡ ! ¡ ymax ¡ ! zmin ¡ ! zmax ¡ ! ¡ Projection Normalization - Ortho Two steps • Translate center to (0, 0, 0) – Move x by –(xmax + xmin) / 2 • Scale volume to cube with sides = 2 – Scale x by 2/(xmax – xmin) • Compose these transformation Compose matrices matrices – Resulting matrix maps Resulting orthogonal volume to canonical orthogonal Projection Normalization - Persp Perspective Normalization is Trickier x § z¡! § y z § z¡! § near = ar ¡ ! § f Perspective Normalization Consider N= 1 0 0 0 After multiplying: • p’ = Np 00 10 0α 0 −1 0 0 β 0 x0 x y0 y z0 ® ¯ z w0 ¡z Perspective Normalization After dividing by w’, p’ -> p’’ 0 x 0 y x 0 x0 y 0 z 0 w 0 0 y ® ¯ z ¡z z 0 0 x ¡ z y ¡ z µ ¡ ¯ ® z ¶ Perspective Normalization Quick Check • If x = z – x’’ = -1 • If x = -z – x’’ = 1 Perspective Normalization What about z? • if z = zmax • if z = zmin µ 0 z0 ¡ ® Ã 0 z0 ¡ ¯ ® ¶ zmax ¯ ! zmin • Solve for α and β such that zmin -1 and zmax 1 Solve • Resulting z’’ is nonlinear, but preserves ordering of points – If z1 < z2 … z’’1 < z’’2 Perspective Normalization We did it. Using matrix, N • Perspective viewing frustum transformed to cube • Orthographic rendering of cube produces same image as Orthographic perspective rendering of original frustum perspective Color Next topic: Color Next Color To understand how to make realistic images, we need a To 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. bit Basics Of Color Elements of color: Basics of Color Physics: Physics: • Illumination – Electromagnetic spectra • Reflection – Material properties – Surface geometry and microgeometry (i.e., polished versus matte Surface versus brushed) versus Perception • Physiology and neurophysiology • Perceptual psychology Physiology of Vision The eye: The retina • Rods • Cones – Color! Physiology of Vision The center of the retina is a densely packed The region called the fovea. fovea • Cones much denser here than the periphery Cones periphery Physiology of Vision: Cones Three types of cones: • L or R, most sensitive to red light (610 nm) most • 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) Physiology of Vision: The Retina Strangely, rods and cones are Strangely, at the back of the retina, back behind a mostly-transparent neural structure that collects their response. collects http://www.trueorigin.org/retina.asp Perception: Metamers A given perceptual sensation of color derives given from the stimulus of all three cone types from Identical perceptions of color can thus be caused Identical by very different spectra by Perception: Other Gotchas Color perception is also difficult because: • It varies from person to person • It is affected by adaptation (stare at a light bulb… don’t) • It is affected by surrounding color: 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 Intensity with intensities: with 0.10 -> 0.11 (10% change) 0.50 -> 0.55 (10% change) will look the same We perceive relative intensities, not absolute We relative Representing Intensities Remaining in the world of black and white… Use photometer to obtain min and max brightness of Use monitor monitor This is the dynamic range This dynamic Intensity ranges from min, I0, to max, 1.0 How do we represent 256 shades of gray? Representing Intensities Equal distribution between min and max fails • relative change near max is much smaller than near I0 • Ex: ¼, ½, ¾, 1 Preserve % change • Ex: 1/8, ¼, ½, 1 • In = I0 * rnI0, n > 0 I0=I0 I 1 = rI 0 I2 = rI1 = r2I0 … I255=rI254=r255I0 Dynamic Ranges Display Dynamic Range Dynamic (max / min illum) CRT: Photo (print) 50-200 100 Photo (slide) B/W printout 1000 100 Color printout Newspaper10 Max # of Perceived Intensities (r=1.01) 400-530 50 465 700 465 400 234 Gamma Correction But most display devices are inherently nonlinear: But Intensity = k(voltage)γ • i.e., brightness * voltage != (2*brightness) * (voltage/2) − γ is between 2.2 and 2.5 on most monitors is Common solution: gamma correction Common gamma • Post-transformation on intensities to map them to linear range on Post-transformation display device: display • Can have separate γ for R, G, B Can y=x 1 γ Gamma Correction Some monitors perform the gamma correction in Some hardware (SGIs) hardware Others do not (most PCs) Tough to generate images that look good on both Tough platforms (i.e. images from web pages) platforms Paul Debevec Top Gun Speaker Wednesday, October 9th at 3:30 – OLS 011 http://www.debevec.org MIT Technolgy Review’s “100 Young MIT Innovators” Innovators” Rendering with Natural Light Fiat Lux Light Stage ...
View Full Document

Ask a homework question - tutors are online