David Luebke2/23/2016 CS 551 / 645: Introductory Computer Graphics Color Continued Clipping in 3D.

Slides:



Advertisements
Similar presentations
CS 445 / 645 Introduction to Computer Graphics Lecture 13 Color Color.
Advertisements

Introduction to Computer Graphics ColorColor. Specifying Color Color perception usually involves three quantities: Hue: Distinguishes between colors like.
Color & Light, Digitalization, Storage. Vision Rods work at low light levels and do not see color –That is, their response depends only on how many photons,
Color To understand how to make realistic images, we need a basic understanding of the physics and physiology of vision.
Color Image Processing
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Color Week 5, Fri Feb.
CS 445 / 645 Introduction to Computer Graphics Lecture 12 Camera Models Lecture 12 Camera Models.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Vision/Color II, Virtual.
School of Computing Science Simon Fraser University
CS 4731: Computer Graphics Lecture 24: Color Science
SWE 423: Multimedia Systems Chapter 4: Graphics and Images (2)
Sep 21, Fall 2005ITCS4010/ Computer Graphics Overview Color Displays Drawing Pipeline.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Color 2 Week 10, Fri 7 Nov 2003.
Sep 21, Fall 2006IAT 4101 Computer Graphics Overview Color Displays Drawing Pipeline.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
Display Issues Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
CS559-Computer Graphics Copyright Stephen Chenney Color Recap The physical description of color is as a spectrum: the intensity of light at each wavelength.
Colour in Computer Graphics Mel Slater. Outline: This time Introduction Spectral distributions Simple Model for the Visual System Simple Model for an.
9/14/04© University of Wisconsin, CS559 Spring 2004 Last Time Intensity perception – the importance of ratios Dynamic Range – what it means and some of.
Any questions about the current assignment? (I’ll do my best to help!)
1 Color vision and representation S M L.
CS 445 / 645: Introductory Computer Graphics Color.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by David Luebke)
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
CS 480/680 Computer Graphics Image Formation Dr. Frederick C Harris, Jr.
Color. Contents Light and color The visible light spectrum Primary and secondary colors Color spaces –RGB, CMY, YIQ, HLS, CIE –CIE XYZ, CIE xyY and CIE.
CS 445 / 645 Introduction to Computer Graphics Lecture 13 Color Color.
Color Theory ‣ What is color? ‣ How do we perceive it? ‣ How do we describe and match colors? ‣ Color spaces.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
David Luebke10/21/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Chapter 2: Color Basics. 2 What is light?  EM wave, radiation  Visible light has a spectrum wavelength from 400 – 780 nm.  Light can be composed.
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CSC361/ Digital Media Burg/Wong
David Luebke11/14/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
COLORCOLOR Angel 1.4 and 2.4 J. Lindblad
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
CS6825: Color 2 Light and Color Light is electromagnetic radiation Light is electromagnetic radiation Visible light: nm. range Visible light:
CS 551 / 645: Introductory Computer Graphics Color.
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
EEL Introduction to Computer Graphics PPT12: Color models Yamini Bura – U
Introduction to Computer Graphics CS 445 / 645 Lecture 12 Chapter 12: Color.
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
CS-321 Dr. Mark L. Hornick 1 Color Perception. CS-321 Dr. Mark L. Hornick 2 Color Perception.
David Luebke 1 2/5/2016 Color CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Lecture 13: Raster Graphics and Scan Conversion
David Luebke3/11/2016 CS 551 / 645: Introductory Computer Graphics Geometric transforms: perspective projection Color.
09/10/02(c) University of Wisconsin, CS559 Fall 2002 Last Time Digital Images –Spatial and Color resolution Color –The physics of color.
Color Measurement and Reproduction Eric Dubois. How Can We Specify a Color Numerically? What measurements do we need to take of a colored light to uniquely.
1 of 32 Computer Graphics Color. 2 of 32 Basics Of Color elements of color:
COMPUTER GRAPHICS CS 482 – FALL 2016 CHAPTER 28 COLOR COLOR PERCEPTION CHROMATICITY COLOR MODELS COLOR INTERPOLATION.
Color Models Light property Color models.
Computer Graphics Overview
CS 551 / 645: Introductory Computer Graphics
Display Issues Ed Angel
Color Image Processing
Color Image Processing
COLOR space Mohiuddin Ahmad.
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006
Color Image Processing
3D Clipping.
Introduction to Computer Graphics with WebGL
Color Representation Although we can differentiate a hundred different grey-levels, we can easily differentiate thousands of colors.
Color Image Processing
Slides taken from Scott Schaefer
Lecture 13 Clipping & Scan Conversion
Color Theory What is color? How do we perceive it?
Presentation transcript:

David Luebke2/23/2016 CS 551 / 645: Introductory Computer Graphics Color Continued Clipping in 3D

David Luebke2/23/2016 Administrivia l Hand back assignment 1 (finally…) l Hand out assignment 3 l Graphics Lunch (Glunch)…Fridays at noon, typically in Olsson 236D (this week in 228E) –Announcements on uva.cs.graphics or at –This week: n Antialiasing on LCD screens n Graphical interface stuff in Windows2000

David Luebke2/23/2016 Recap: Basics of Color l Physics: –Illumination n Electromagnetic spectra –Reflection n Material properties (i.e., conductance) n Surface geometry and microgeometry (i.e., polished versus matte versus brushed) l Perception –Physiology and neurophysiology –Perceptual psychology

David Luebke2/23/2016 Recap: Physiology of Vision l The retina –Rods –Cones

David Luebke2/23/2016 Recap: Cones l Three types of cones: –L or R, most sensitive to red light (610 nm) –M or G, most sensitive to blue light (560 nm) –S or B, most sensitive to blue light (430 nm) –Color blindness results from missing cone type(s)

David Luebke2/23/2016 Recap: Metamers l A given perceptual sensation of color derives from the stimulus of all three cone types l Identical perceptions of color can thus be caused by very different spectra

David Luebke2/23/2016 Recap: Perceptual Gotchas l Color perception is also difficult because: –It varies from person to person (thus std observers) –It is affected by adaptation (transparency demo) –It is affected by surrounding color:

David Luebke2/23/2016 Color Spaces l Three types of cones suggests color is a 3D quantity. How to define 3D color space? l Idea: shine given wavelength ( ) on a screen, and mix three other wavelengths (R,G,B) on same screen. Have user adjust intensity of RGB until colors are identical: l How closely does this correspond to a color CRT? l Problem: sometimes need to “subtract” R to match

David Luebke2/23/2016 CIE Color Space l The CIE (Commission Internationale d’Eclairage) came up with three hypothetical lights X, Y, and Z with these spectra: l Idea: any wavelength can be matched perceptually by positive combinations of X,Y,Z l Note that: X ~ R + B Y ~ G + everything Z ~ B

David Luebke2/23/2016 CIE Color Space l The gamut of all colors perceivable is thus a three-dimensional shape in X,Y,Z: l For simplicity, we often project to the 2D plane X+Y+Z=1 X = X / (X+Y+Z) Y = Y / (X+Y+Z) Z = 1 - X - Y

David Luebke2/23/2016 CIE Chromaticity Diagram (1931)

David Luebke2/23/2016 Device Color Gamuts l Since X, Y, and Z are hypothetical light sources, no real device can produce the entire gamut of perceivable color l Example: CRT monitor

David Luebke2/23/2016 Device Color Gamuts l The RGB color cube sits within CIE color space something like this:

David Luebke2/23/2016 Device Color Gamuts l We can use the CIE chromaticity diagram to compare the gamuts of various devices: l Note, for example, that a color printer cannot reproduce all shades available on a color monitor

David Luebke2/23/2016 Converting Color Spaces l Simple matrix operation: The transformation C 2 = M -1 2 M 1 C 1 yields RGB on monitor 2 that is equivalent to a given RGB on monitor 1

David Luebke2/23/2016 Converting Color Spaces l Converting between color models can also be expressed as such a matrix transform: l YIQ is the color model used for color TV in America. Y is luminance, I & Q are color –Note: Y is the same as CIE’s Y –Result: backwards compatibility with B/W TV!

David Luebke2/23/2016 Gamma Correction l We generally assume colors are linear l But most display devices are inherently nonlinear –I.e., brightness(voltage) != 2*brightness(voltage/2) l Common solution: gamma correction –Post-transformation on RGB values to map them to linear range on display device: –Can have separate  for R, G, B

David Luebke2/23/2016 Next Topic: 3-D Clipping

David Luebke2/23/ D Clipping l Before actually drawing on the screen, we have to clip (Why?) –Safety: avoid writing pixels that aren’t there –Efficiency: save computation cost of rasterizing primitives outside the field of view l Can we transform to screen coordinates first, then clip in 2-D? –Correctness: shouldn’t draw objects behind viewer (what will an object with negative z coordinates do in our perspective matrix?) (draw it…)

David Luebke2/23/2016 Perspective Projection l Recall the matrix: l Or, in 3-D coordinates:

David Luebke2/23/2016 Clipping Under Perspective l Problem: after multiplying by a perspective matrix and performing the homogeneous divide, a point at (-8, -2, -10) looks the same as a point at (8, 2, 10). l Solution A: clip before multiplying the point by the projection matrix –I.e., clip in camera coordinates l Solution B: clip before the homogeneous divide –I.e., clip in homogeneous coordinates

David Luebke2/23/2016 Clipping Under Perspective l We will talk first about solution A: Clip against view volume Apply projection matrix and homogeneous divide Transform into viewport for 2-D display 3-D world coordinate primitives Clipped world coordinates 2-D device coordinates Canonical screen coordinates

David Luebke2/23/2016 Recap: Perspective Projection l The typical view volume is a frustum or truncated pyramid –In viewing coordinates: x or y z

David Luebke2/23/2016 Perspective Projection l The viewing frustum consists of six planes l The Sutherland-Cohen algorithm (clipping polygons to a region one plane at a time) generalizes to 3-D –Clip polygons against six planes of view frustum –So what’s the problem?

David Luebke2/23/2016 Perspective Projection l The viewing frustum consists of six planes l The Sutherland-Cohen algorithm (clipping polygons to a region one plane at a time) generalizes to 3-D –Clip polygons against six planes of view frustum –So what’s the problem? l The problem: clipping a line segment to an arbitrary plane is relatively expensive –Dot products and such

David Luebke2/23/2016 Perspective Projection l In fact, for simplicity we prefer to use the canonical view frustum: 1 x or y z Front or hither plane Back or yon plane Why is this going to be simpler?

David Luebke2/23/2016 Perspective Projection l In fact, for simplicity we prefer to use the canonical view frustum: 1 x or y z Front or hither plane Back or yon plane Why is the yon plane at z = -1, not z = 1?

David Luebke2/23/2016 Clipping Under Perspective l So we have to refine our pipeline model: –Note that this model forces us to separate projection from modeling & viewing transforms Apply normalizing transformation projection matrix; homogeneous divide Transform into viewport for 2-D display 3-D world coordinate primitives 2-D device coordinates Clip against canonical view volume

David Luebke2/23/2016 Clipping Homogeneous Coords l Another option is to clip the homogeneous coordinates directly. –This allows us to clip after perspective projection: –What are the advantages? Clip against view volume Apply projection matrix Transform into viewport for 2-D display 3-D world coordinate primitives 2-D device coordinates Homogeneous divide

David Luebke2/23/2016 Clipping Homogeneous Coords l Other advantages: –Can transform the canonical view volume for perspective projections to the canonical view volume for parallel projections n Clip in the latter (only works in homogeneous coords) n Allows an optimized (hardware) implementation –Some primitives will have w  1 n For example, polygons that result from tesselating splines n Without clipping in homogeneous coords, must perform divide twice on such primitives

David Luebke2/23/2016 Clipping: The Real World l In the Real World, a common shortcut is: Projection matrix; homogeneous divide Clip in 2-D screen coordinates Clip against hither and yon planes Transform into screen coordinates