r g r b if b g or intensity i
play

[ ] ( R G ) ( R B ) + if (B > G), - PowerPoint PPT Presentation

University of British Columbia News News Review: Trichromacy and Metamers CPSC 314 Computer Graphics Im back! Homework 1 returned today three types of cones Jan-Apr 2008 including office hours Wed/Fri after lecture in lab


  1. University of British Columbia News News Review: Trichromacy and Metamers CPSC 314 Computer Graphics • I’m back! • Homework 1 returned today • three types of cones Jan-Apr 2008 • including office hours Wed/Fri after lecture in lab • average 84 • color is combination • this week • Project 1 face-to-face grading done Tamara Munzner of cone stimuli • Fri 2/29: Homework 2 due 1pm sharp • average 96 • metamer: identically • Fri 2/29: Project 2 due 6pm • stragglers contact Cody, cjrobson@cs, ASAP perceived color • extra TA office hours in lab this week to • penalty for noshows, nosignups Color II, Lighting/Shading I caused by very answer questions • the glorious P1 Hall of Fame! different spectra • Tue 2-4 (usual lab 1-2) • Thu 2-4 (usual lab 10-11) Week 7, Mon Feb 25 • Fri 2-4 (usual lab 12-1) • reminder: midterm next Fri Mar 7 http://www.ugrad.cs.ubc.ca/~cs314/Vjan2008 2 3 4 Review: Measured vs. CIE Color Spaces CIE Gamut and λ Chromaticity Diagram CIE “Horseshoe” Diagram Facts CIE “Horseshoe” Diagram Facts • all visible colors lie inside the horseshoe • a point C can be chosen as a white point corresponding to an illuminant • 3D gamut • result from color matching experiments • usually this point is of the curve swept out by the • spectral (monochromatic) colors lie around black body radiation spectra for different the border temperatures • relative to C, two colors are called complementary if • the straight line between blue and red contains they are located along a line segment through C, but the purple tones on opposite sides (i.e C is an affine combination of • colors combine linearly (i.e. along lines), since the two colors) • measured basis the xy-plane is a plane from a linear space • the dominant wavelength of the color is found by • transformed basis • monochromatic lights extending the line from C through the color to the • “imaginary” lights • physical observations edge of the diagram • all positive, unit area • negative lobes • chromaticity diagram • some colors (i.e. purples) do not have a dominant • Y is luminance, no hue • hue only, no intensity wavelength, but their complementary color does • X, Z hue, no luminance 5 6 7 8 Color Interpolation, CIE RGB Color Space (Color Cube) Device Color Gamuts Dominant & Opponent Wavelength Diagram • use CIE chromaticity diagram to compare the • define colors with (r, g, b) gamuts of various devices amounts of red, green, and blue • Blackbody • X, Y, and Z are hypothetical light sources, not curve • used by OpenGL • Illumination: used in practice as device primaries • hardware-centric Complementary wavelength Complementary wavelength • Candle • describes the colors that can 2000K be generated with specific • Light bulb RGB light sources 3000K (A) • Sunset/ • RGB color cube sits within CIE sunrise color space 3200K • Day light • subset of perceivable colors 6500K (D) • scaled, rotated, sheared cube • Overcast day 7000K • Lightning >20,000K 9 10 11 12 Gamut Mapping Additive vs. Subtractive Colors HSV Color Space HSI/HSV and RGB • additive: light • HSV/HSI conversion from RGB C 1 R • more intuitive color space for people � � � � � � • hue same in both • monitors, LCDs Saturation • H = Hue � � � � � � • value is max, intensity is average Value M 1 G = � • S = Saturation • RGB model � � � � � � • V = Value 1 Y 1 B • subtractive: pigment � � � � � � � � • or brightness B [ ] ( R G ) ( R B ) � � � � � � � + � if (B > G), � � • or intensity I 2 1 H cos � = • printers • or lightness L � � H = 360 - H 2 ( R G ) ( R B )( G B ) Hue � + � � � � • CMY(K) model � � S = 1 � min( R , G , B ) R G B + + • HSI: I = 3 I S = 1 � min( R , G , B ) V = max( R , G , B ) • HSV: 13 14 15 V 16

  2. YIQ Color Space HSV Does Not Encode Luminance Luminance and Gamma Correction RGB Component Color (OpenGL) I • color model used for color TV • luminance • humans have nonlinear response to brightness • simple model of color using RGB triples Q • Y of YIQ • luminance 18% of X seems half as bright as X • component-wise multiplication • Y is luminance (same as CIE) • 0.299R + 0.587G + 0.114B • thus encode luminance nonlinearly: perceptually uniform • (a0,a1,a2) * (b0,b1,b2) = (a0*b0, a1*b1, a2*b2) • I & Q are color (not same I as HSI!) domain uses bits efficiently • luminance takes into effect that eye spectral response is wavelength- • high quality with 8 bits, instead of 14 bits if linear • using Y backwards compatible for B/W TVs dependent • monitors, sensors, eye all have different reponses • conversion from RGB is linear • CRT monitors inverse nonlinear, LCD panels linear Y 0 . 30 0 . 59 0 . 11 R � � � � � � • characterize by gamma � � � � � � I 0 . 60 0 . 28 0 . 32 G • displayedIntensity = a γ (maxIntensity) = � � � � � � � � Q 0 . 21 0 . 52 0 . 31 B • gamma correction � � � � � � � • value/intensity/brightness � � � � � � � 1 / � � � � • displayedIntensity = (maxIntensity) = a (maxIntensity) a • I/V/B of HSI/HSV/HSB � � � • green is much lighter than red, and red lighter • gamma for CRTs around 2.4 • why does this work? • 0.333R + 0.333G + 0.333B than blue • lose information! • because of light, human vision, color spaces, ... 17 18 19 20 http://www.yorku.ca/eye/photopik.htm www.csse.uwa.edu.au/~robyn/Visioncourse/colour/lecture/node5.html Rendering Pipeline Projective Rendering Pipeline Goal • simulate interaction of light and objects • fast: fake it! object world viewing • approximate the look, ignore real physics O2W O2W W2V W2V V2C V2C Model/View Geometry Perspective VCS VCS OCS WCS WCS OCS Lighting Clipping • local model: interaction of each object with light Transform. Transform. Database projection projection modeling viewing modeling viewing transformation transformation • vs. global model: interaction of objects with each other transformation transformation transformation transformation clipping C2N C2N CCS CCS Lighting I OCS - object/model coordinate system perspective perspective Frame- Scan Depth WCS - world coordinate system normalized divide divide Texturing Blending buffer Conversion Test device local global VCS - viewing/camera/eye coordinate N2D N2D system NDCS NDCS viewport viewport CCS - clipping coordinate system transformation transformation NDCS - normalized device coordinate device system DCS DCS DCS - device/display/screen coordinate 21 22 23 24 system Illumination in the Pipeline Light Sources Light Sources Light Sources • local illumination • types of light sources • area lights • ambient lights • only models light arriving directly from light • glLightfv(GL_LIGHT0,GL_POSITION,light[]) • light sources with a finite area • no identifiable source or direction • directional/parallel lights source x � � • more realistic model of many light sources • hack for replacing true global illumination • real-life example: sun � � • no interreflections or shadows y � � • not available with projective rendering pipeline • (diffuse interreflection: light bouncing off from • infinitely far source: homogeneous coord w=0 z � � • can be added through tricks, multiple � � other objects) 0 (i.e., not available with OpenGL) • point lights rendering passes � � x • same intensity in all directions • light sources � � � � y • spot lights � � • simple shapes z � � • limited set of directions: � � • materials 1 � � • point+direction+cutoff angle • simple, non-physical reflection models 25 26 27 28 Diffuse Interreflection Ambient Light Sources Directional Light Sources Point Light Sources • scene lit only with an ambient light source • scene lit with ambient and directional light • scene lit with ambient and point light source Light Position Light Position Not Important Important Light Position Viewer Position Not Important Viewer Position Not Important Surface Angle Important Important Viewer Position Not Important Surface Angle Surface Angle Not Important Important 29 30 31 32

Recommend


More recommend