correction w2v vs v2w recorrection perspective derivation
play

Correction: W2V vs. V2W Recorrection: Perspective Derivation - PowerPoint PPT Presentation

University of British Columbia Correction: W2V vs. V2W Recorrection: Perspective Derivation Reading for This Module CPSC 314 Computer Graphics L/R sign error slide 26, Viewing slide 91, Viewing FCG Chapter 10 Surface Shading Jan-Apr 2013


  1. University of British Columbia Correction: W2V vs. V2W Recorrection: Perspective Derivation Reading for This Module CPSC 314 Computer Graphics L/R sign error slide 26, Viewing slide 91, Viewing • FCG Chapter 10 Surface Shading Jan-Apr 2013 x = left � � x / w = � 1 � � � � � � � x ' E 0 A 0 x x ' = Ex + Az • M V2W =(M W2V ) -1 = R -1 T -1 � � � � � � x = right � � x / w = 1 � • FCG Section 8.2.4-8.2.5 y ' 0 F B 0 y y ' = Fy + Bz � � � � � � = y = top � � y / w = 1 � Tamara Munzner � � � � � � u x u y u z 0 1 0 0 � e x u x u y u z � e • u � z ' � � 0 0 C D � � z � z ' = Cz + D � � � � � � � � � � � � y = bottom � � y / w = � 1 � v x v y v z 0 0 1 0 � e y v x v y v z � e • v w ' 0 0 � 1 0 1 � � � � � � w ' = � z � � � � � � M view 2 world = = • RB Chap Lighting z = � near � � z / w = � 1 � � w x w y w z 0 � � 0 0 1 � e z � � w x w y w z � e • w � � � � � � � z = � far � � z / w = 1 � 0 0 0 1 0 0 0 1 0 0 0 1 � � � � � � z axis flip! y ' = Fy + Bz , y ' w ' = Fy + Bz , 1 = Fy + Bz , 1 = Fy + Bz Lighting/Shading , � u x u y u z � e x � u x + � e y � u y + � e z � u z � w ' w ' � z � � v x v y v z � e x � v x + � e y � v y + � e z � v z 1 = F y � z + B z � z , 1 = F y top � � M V 2 W = � z � B , 1 = F � ( � near ) � B , � � w x w y w z � e x � w x + � e y � w y + � e z � w z � � 1 = F top http://www.ugrad.cs.ubc.ca/~cs314/Vjan2013 0 0 0 1 � � near � B 2 3 4 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 W2V V2C Geometry Model/View Perspective VCS OCS WCS Lighting Clipping • get the physics (more) right Database Transform. Transform. projection modeling viewing transformation • BRDFs: Bidirectional Reflection Distribution Functions transformation transformation clipping • local model: interaction of each object with light C2N CCS Lighting I OCS - object/model coordinate system • global model: interaction of objects with each other perspective Frame- WCS - world coordinate system Scan Depth divide normalized Texturing Blending Conversion buffer Test device VCS - viewing/camera/eye coordinate N2D system NDCS viewport CCS - clipping coordinate system transformation NDCS - normalized device coordinate device system DCS DCS - device/display/screen coordinate system 5 6 7 8 Photorealistic Illumination Illumination in the Pipeline Light Sources Light Sources • transport of energy from light sources to surfaces & points • local illumination • types of light sources • area lights • global includes direct and indirect illumination – more later • only models light arriving directly from light • glLightfv(GL_LIGHT0,GL_POSITION,light[]) • light sources with a finite area • directional/parallel lights source x � � • more realistic model of many light sources • real-life example: sun � � • no interreflections or shadows y � � • not available with projective rendering pipeline • infinitely far source: homogeneous coord w=0 z � � • can be added through tricks, multiple [electricimage.com] � � 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 Henrik Wann Jensen • simple, non-physical reflection models 9 10 11 12 Light Sources Diffuse Interreflection Ambient Light Sources Directional Light Sources • ambient lights • scene lit only with an ambient light source • scene lit with directional and ambient light • no identifiable source or direction • hack for replacing true global illumination Light Position Not Important • (diffuse interreflection: light bouncing off from other objects) Light Position Viewer Position Not Important Not Important Surface Angle Important Viewer Position Not Important Surface Angle Not Important 13 14 15 16

  2. Point Light Sources Light Sources Types of Reflection Specular Highlights • geometry: positions and directions • specular (a.k.a. mirror or regular ) reflection causes • scene lit with ambient and point light source light to propagate without scattering. • standard: world coordinate system • effect: lights fixed wrt world geometry • demo: Light Position • diffuse reflection sends light in all directions with Important http://www.xmission.com/~nate/tutors.html equal energy. • alternative: camera coordinate system Viewer Position • effect: lights attached to camera (car headlights) Important • points and directions undergo normal model/ • mixed reflection is a weighted view transformation combination of specular and diffuse. Surface Angle • illumination calculations: camera coords Important 17 18 19 20 Types of Reflection Reflectance Distribution Model Surface Roughness Surface Roughness • retro-reflection occurs when incident energy • at a microscopic scale, all • most surfaces exhibit complex reflectances reflects in directions close to the incident real surfaces are rough • vary with incident and reflected directions. direction, for a wide range of incident • model with combination • notice another effect of roughness: directions. • each “microfacet” is treated as a perfect mirror. • cast shadows on + + = • incident light reflected in different directions by themselves • gloss is the property of a material surface different facets. shadow that involves mixed reflection and is shadow • end result is mixed reflectance. specular + glossy + diffuse = • “ mask ” reflected light: • smoother surfaces are more specular or glossy. responsible for the mirror like appearance of reflectance distribution • random distribution of facet normals results in diffuse rough surfaces. reflectance. Masked Light 21 22 23 24 Physics of Diffuse Reflection Lambert ’ s Cosine Law Lambert ’ s Law Computing Diffuse Reflection • depends on angle of incidence: angle between surface • ideal diffuse reflection normal and incoming light • ideal diffuse surface reflection • very rough surface at the microscopic level l n • I diffuse = k d I light cos θ the energy reflected by a small portion of a surface from a light source • real-world example: chalk in a given direction is proportional to the cosine of the angle between • in practice use vector arithmetic that direction and the surface normal θ • microscopic variations mean incoming ray of • I diffuse = k d I light (n • l) • reflected intensity light equally likely to be reflected in any • independent of viewing direction • always normalize vectors used in lighting!!! direction over the hemisphere • n, l should be unit vectors • depends on surface orientation wrt light intuitively: cross-sectional area of • what does the reflected intensity depend on? the “ beam ” intersecting an element • often called Lambertian surfaces • scalar (B/W intensity) or 3-tuple or 4-tuple (color) of surface area is smaller for greater • k d : diffuse coefficient, surface color angles with the normal. • I light : incoming light intensity • I diffuse : outgoing light intensity (for diffuse reflection) 25 26 27 28 Diffuse Lighting Examples Specular Highlights Physics of Specular Reflection Optics of Reflection • Lambertian sphere from several lighting • at the microscopic level a specular reflecting • reflection follows Snell ’ s Law: angles: surface is very smooth • incoming ray and reflected ray lie in a plane with the surface normal • angle the reflected ray forms with surface • thus rays of light are likely to bounce off the normal equals angle formed by incoming ray microgeometry in a mirror-like fashion • need only consider angles from 0° to 90° and surface normal • why? • the smoother the surface, the closer it • demo: Brown exploratory on reflection becomes to a perfect mirror • http://www.cs.brown.edu/exploratories/freeSoftware/repository/edu/brown/cs/ θ (l)ight = θ (r)eflection exploratories/applets/reflection2D/reflection_2d_java_browser.html 29 30 31 32 Michiel van de Panne

Recommend


More recommend