University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Advanced Rendering II.

Slides:



Advertisements
Similar presentations
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Advertisements

Lecture 14 Illumination II – Global Models
3D Graphics Rendering and Terrain Modeling
Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Lighting/Shading III Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Clipping Week 8, Wed Mar.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Shading, Advanced Rendering.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Alla Sheffer Advanced Rendering Week.
MC930/MO603 Ray Casting. Light is bouncing photons.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Advanced Rendering II,
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Advanced Rendering III,
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
7M836 Animation & Rendering
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 14: Ray Tracing
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
Ray Tracing 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 2: Basic Ray Tracing Ravi Ramamoorthi Some slides courtesy.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
CSC418 Computer Graphics n Raytracing n Shadows n Global Illumination.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Advanced Rendering University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Today More raytracing stuff –Soft shadows and anti-aliasing More rendering methods –The text book is good on this –I’ll be using images from the CDROM.
12/05/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling Very brief intro to global illumination.
-Global Illumination Techniques
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 445 / 645: Introductory Computer Graphics Light.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Graphics Lecture 13: Slide 1 Interactive Computer Graphics Lecture 13: Radiosity - Principles.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Procedural Approaches.
04/30/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling We are now all done with modeling, the standard hardware pipeline.
Basic Ray Tracing CMSC 435/634.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
CS 445 / 645 Introduction to Computer Graphics Lecture 15 Shading Shading.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Lighting/Shading IV Advanced Rendering I Week 8, Mon Mar 3
CSCE 441: Computer Graphics Ray Tracing
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Radiosity Radiosity.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
RENDERING : Global Illumination
Sub-Surface Scattering Real-time Rendering Sub-Surface Scattering CSE 781 Prof. Roger Crawfis.
Ray Tracing I. Reading Hill, Chapter 14, Sections 14.1 to 14.5 Hill, Chapter 14, Sections and
CS 376 Introduction to Computer Graphics 04 / 18 / 2007 Instructor: Michael Eckmann.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
CS552: Computer Graphics Lecture 36: Ray Tracing.
CSE 167 [Win 17], Lecture 15: Ray Tracing Ravi Ramamoorthi
Photorealistic Rendering vs. Interactive 3D Graphics
3D Graphics Rendering PPT By Ricardo Veguilla.
© University of Wisconsin, CS559 Fall 2004
Lighting/Shading IV, Advanced Rendering I Week 7, Fri Mar 5
(c) 2002 University of Wisconsin
CS5500 Computer Graphics May 29, 2006
Presentation transcript:

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Advanced Rendering II Week 7, Fri Mar 2

2 Reading for Last and This Time FCG Chap 10 Ray Tracing only FCG Chap 25 Image-Based Rendering

3 News signup sheet for P2 grading Mon 11-12, 2-3, 5-5:30 Tue 11-1 Wed 11-12, 2-3, 5-5:30

4 Review: Shading Models flat shading compute Phong lighting once for entire polygon Gouraud shading compute Phong lighting at the vertices and interpolate lighting values across polygon Phong shading compute averaged vertex normals interpolate normals across polygon and perform Phong lighting across polygon

5 Review/Clarification: Specifying Normals OpenGL state machine uses last normal specified if no normals specified, assumes all identical per-vertex normals glNormal3f(1,1,1); glVertex3f(3,4,5); glNormal3f(1,1,0); glVertex3f(10,5,2); per-face normals glNormal3f(1,1,1); glVertex3f(3,4,5); glVertex3f(10,5,2); normal interpreted as direction from vertex location can automatically normalize (computational cost) glEnable(GL_NORMALIZE);

6 Review: Recursive Ray Tracing ray tracing can handle reflection (chrome/mirror) refraction (glass) shadows one primary ray per pixel spawn secondary rays reflection, refraction if another object is hit, recurse to find its color shadow cast ray from intersection point to light source, check if intersects another object termination criteria no intersection (ray exits scene) max bounces (recursion depth) attenuated below threshold Image Plane Light Source Eye Refracted Ray Reflected Ray Shadow Rays

7 Review: Reflection and Refraction refraction: mirror effects perfect specular reflection refraction: at boundary Snell’s Law light ray bends based on refractive indices c 1, c 2 n d t n

8 Advanced Rendering II

9 Ray Trees all rays directly or indirectly spawned off by a single primary ray

10 Ray Tracing issues: generation of rays intersection of rays with geometric primitives geometric transformations lighting and shading efficient data structures so we don’t have to test intersection with every object

11 Ray Generation camera coordinate system origin: C (camera position) viewing direction: v up vector: u x direction: x= v  u note: corresponds to viewing transformation in rendering pipeline like gluLookAt u v x C

12 Ray Generation other parameters: distance of camera from image plane: d image resolution (in pixels): w, h left, right, top, bottom boundaries in image plane: l, r, t, b then: lower left corner of image: pixel at position i, j (i=0..w-1, j=0..h-1) : u v x C

13 Ray Generation ray in 3D space: where t= 0… 

14 Ray Tracing issues: generation of rays intersection of rays with geometric primitives geometric transformations lighting and shading efficient data structures so we don’t have to test intersection with every object

15 inner loop of ray-tracing must be extremely efficient task: given an object o, find ray parameter t, such that R i,j (t) is a point on the object such a value for t may not exist solve a set of equations intersection test depends on geometric primitive ray-sphere ray-triangle ray-polygon Ray - Object Intersections

16 Ray Intersections: Spheres spheres at origin implicit function ray equation

17 Ray Intersections: Spheres to determine intersection: insert ray R i,j (t) into S(x,y,z): solve for t (find roots) simple quadratic equation

18 Ray Intersections: Other Primitives implicit functions spheres at arbitrary positions same thing conic sections (hyperboloids, ellipsoids, paraboloids, cones, cylinders) same thing (all are quadratic functions!) polygons first intersect ray with plane linear implicit function then test whether point is inside or outside of polygon (2D test) for convex polygons suffices to test whether point in on the correct side of every boundary edge similar to computation of outcodes in line clipping (upcoming)

19 Ray-Triangle Intersection method in book is elegant but a bit complex easier approach: triangle is just a polygon intersect ray with plane check if ray inside triangle a b c e d x n

20 Ray-Triangle Intersection check if ray inside triangle check if point counterclockwise from each edge (to its left) check if cross product points in same direction as normal (i.e. if dot is positive) more details at a b c x n CCW

21 Ray Tracing issues: generation of rays intersection of rays with geometric primitives geometric transformations lighting and shading efficient data structures so we don’t have to test intersection with every object

22 Geometric Transformations similar goal as in rendering pipeline: modeling scenes more convenient using different coordinate systems for individual objects problem not all object representations are easy to transform problem is fixed in rendering pipeline by restriction to polygons, which are affine invariant ray tracing has different solution ray itself is always affine invariant thus: transform ray into object coordinates!

23 Geometric Transformations ray transformation for intersection test, it is only important that ray is in same coordinate system as object representation transform all rays into object coordinates transform camera point and ray direction by inverse of model/view matrix shading has to be done in world coordinates (where light sources are given) transform object space intersection point to world coordinates thus have to keep both world and object-space ray

24 Ray Tracing issues: generation of rays intersection of rays with geometric primitives geometric transformations lighting and shading efficient data structures so we don’t have to test intersection with every object

25 Local Lighting local surface information (normal…) for implicit surfaces F(x,y,z) =0: normal n(x,y,z) can be easily computed at every intersection point using the gradient example: needs to be normalized!

26 Local Lighting local surface information alternatively: can interpolate per-vertex information for triangles/meshes as in rendering pipeline now easy to use Phong shading! as discussed for rendering pipeline difference with rendering pipeline: interpolation cannot be done incrementally have to compute barycentric coordinates for every intersection point (e.g plane equation for triangles)

27 Global Shadows approach to test whether point is in shadow, send out shadow rays to all light sources if ray hits another object, the point lies in shadow

28 Global Reflections/Refractions approach send rays out in reflected and refracted direction to gather incoming light that light is multiplied by local surface color and added to result of local shading

29 Total Internal Reflection

30 Ray Tracing issues: generation of rays intersection of rays with geometric primitives geometric transformations lighting and shading efficient data structures so we don’t have to test intersection with every object

31 Optimized Ray-Tracing basic algorithm simple but very expensive optimize by reducing: number of rays traced number of ray-object intersection calculations methods bounding volumes: boxes, spheres spatial subdivision uniform BSP trees (more on this later with collision)

32 Example Images

33 Radiosity radiosity definition rate at which energy emitted or reflected by a surface radiosity methods capture diffuse-diffuse bouncing of light indirect effects difficult to handle with raytracing

34 Radiosity illumination as radiative heat transfer conserve light energy in a volume model light transport as packet flow until convergence solution captures diffuse-diffuse bouncing of light view-independent technique calculate solution for entire scene offline browse from any viewpoint in realtime heat/light source thermometer/eye reflective objects energy packets

35 Radiosity [IBM] divide surfaces into small patches loop: check for light exchange between all pairs form factor: orientation of one patch wrt other patch (n x n matrix) escience.anu.edu.au/lecture/cg/GlobalIllumination/Image/continuous.jpg escience.anu.edu.au/lecture/cg/GlobalIllumination/Image/discrete.jpg

36 Better Global Illumination ray-tracing: great specular, approx. diffuse view dependent radiosity: great diffuse, specular ignored view independent, mostly-enclosed volumes photon mapping: superset of raytracing and radiosity view dependent, handles both diffuse and specular well raytracing photon mapping graphics.ucsd.edu/~henrik/images/cbox.html

37 Subsurface Scattering: Translucency light enters and leaves at different locations on the surface bounces around inside technical Academy Award, 2003 Jensen, Marschner, Hanrahan

38 Subsurface Scattering: Marble

39 Subsurface Scattering: Milk vs. Paint

40 Subsurface Scattering: Skin

41 Subsurface Scattering: Skin

42 Non-Photorealistic Rendering simulate look of hand-drawn sketches or paintings, using digital models /

43 Non-Photorealistic Shading cool-to-warm shading standard cool-to-warmwith edges/creases

44 Non-Photorealistic Shading draw silhouettes: if, e=edge-eye vector draw creases: if standard cool-to-warmwith edges/creases

45 Image-Based Modelling and Rendering store and access only pixels no geometry, no light simulation,... input: set of images output: image from new viewpoint surprisingly large set of possible new viewpoints interpolation allows translation, not just rotation lightfield, lumigraph: translate outside convex hull of object QuickTimeVR: camera rotates, no translation can point camera in or out

46 Image-Based Rendering display time not tied to scene complexity expensive rendering or real photographs example: Matrix bullet-time scene array of many cameras allows virtual camera to "freeze time" convergence of graphics, vision, photography computational photography