CS559: Computer Graphics Lecture 27: Animation, Depth & Motion Blur, Ray Tracing Li Zhang Spring 2010 Slides from Brian Curless at U of Washington.

Slides:



Advertisements
Similar presentations
1 05/10/2014 Computer Graphics Lecture 10 Global Illumination 1: Ray Tracing and Radiosity Taku Komura.
Advertisements

Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Lecture 14 Illumination II – Global Models
Computer Graphics In4/MSc Computer Graphics Lecture Notes #15 Illumination III View Independent Rendering.
Ray Tracing CMSC 635. Basic idea How many intersections?  Pixels  ~10 3 to ~10 7  Rays per Pixel  1 to ~10  Primitives  ~10 to ~10 7  Every ray.
Part I: Basics of Computer Graphics
David Luebke1/19/99 CS 551/651: Advanced Computer Graphics David Luebke
Christian Lauterbach COMP 770, 2/11/2009
CS 325 Introduction to Computer Graphics 04 / 09 / 2010 Instructor: Michael Eckmann.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 15: Ray Tracing/Global Illumination Ravi Ramamoorthi Slides.
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
RAY TRACING.
1 View Coherence Acceleration for Ray Traced Animation University of Colorado at Colorado Springs Master’s Thesis Defense by Philip Glen Gage April 19,
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 10: Global Illumination Ravi Ramamoorthi Some images courtesy.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 14: Ray Tracing
Ray Tracing Outline For each pixel { Shoot ray r from eye to center of pixel with trace( r ) } function trace( r ) For each object { Find object with closest.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
Ray Tracing 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
Lecture 8 Advanced Rendering – Ray Tracing, Radiosity & NPR.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 2: Basic Ray Tracing Ravi Ramamoorthi Some slides courtesy.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
CSC418 Computer Graphics n Raytracing n Shadows n Global Illumination.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
Advanced Rendering University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Animation Vladimir Savchenko
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.
12/05/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling Very brief intro to global illumination.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
Raytracing and Global Illumination Intro. to Computer Graphics, CS180, Fall 2008 UC Santa Barbara.
Ray Tracing Jian Huang, CS 594, Fall, 2002 This set of slides are used at Ohio State by Prof. Roger Crawfis.
Foundations of Computer Graphics (Spring 2012) CS 184, Lectures 16, 18: Nuts and bolts of Ray Tracing Acknowledgements:
CS559: Computer Graphics Lecture 15: Hierarchical Modeling and Shading Li Zhang Spring 2008.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
CS559: Computer Graphics Lecture 36: Animation Li Zhang Spring 2008 Many slides from James Kuffner’s graphics class at CMU.
CS559: Computer Graphics Lecture 36: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
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.
第五课 Ray Tracing. Overview of the Section Why Ray Tracing? What is Ray Tracing? How to tracing rays? How to accelerating ray-tracing?
CS559: Computer Graphics Lecture 28: Ray Tracing Li Zhang Spring 2010 Slides are from Ravi Ramamoorthi’s graphics class at Columbia U.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Ray Tracing II. HW1 Part A due October 10 Camera module Object module –Read from a file –Sphere and Light only Ray tracer module: –No shading. No reflection.
Advanced topics Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2006/01/04 with slides by Brian Curless, Zoran Popovic, Mario Costa Sousa.
CSCE 441: Computer Graphics Ray Tracing
In the name of God Computer Graphics. Last Time Some techniques for modeling Today Global illumination and raytracing.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
More on Ray Tracing Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, April 14, 2004.
RENDERING : Global Illumination
David Luebke3/12/2016 Advanced Computer Graphics Lecture 3: More Ray Tracing David Luebke
CS 325 Introduction to Computer Graphics 04 / 07 / 2010 Instructor: Michael Eckmann.
CS559: Computer Graphics Lecture 27: Animation, Depth & Motion Blur, Ray Tracing Li Zhang Spring 2010 Slides from Brian Curless at U of Washington.
CS552: Computer Graphics Lecture 36: Ray Tracing.
CS559: Computer Graphics Lecture 26: Animation Li Zhang Spring 2010 Slides from Brian Curless at U of Washington.
Basic Ray Tracing CMSC 435/634.
Advanced Computer Graphics
Computer Graphics CSE 167 [Win 17], Lectures 16, 17:
CSE 167 [Win 17], Lecture 15: Ray Tracing Ravi Ramamoorthi
Photorealistic Rendering vs. Interactive 3D Graphics
Lecture 36: Animation Li Zhang Spring 2008
© University of Wisconsin, CS559 Fall 2004
Lecture 36: Animation Li Zhang Spring 2008
CSCE 441: Computer Graphics Ray Tracing
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

CS559: Computer Graphics Lecture 27: Animation, Depth & Motion Blur, Ray Tracing Li Zhang Spring 2010 Slides from Brian Curless at U of Washington

Particle system diff. eq. solver We can solve the evolution of a particle system again using the Euler method: void EulerStep(ParticleSystem p, float DeltaT){ ParticleDeriv(p,temp1); /* get deriv */ ScaleVector(temp1,DeltaT) /* scale it */ ParticleGetState(p,temp2); /* get state */ AddVectors(temp1,temp2,temp2); /* add -> temp2 */ ParticleSetState(p,temp2); /* update state */ p->t += DeltaT; /* update time */ } void EulerStep(ParticleSystem p, float DeltaT){ ParticleDeriv(p,temp1); /* get deriv */ ScaleVector(temp1,DeltaT) /* scale it */ ParticleGetState(p,temp2); /* get state */ AddVectors(temp1,temp2,temp2); /* add -> temp2 */ ParticleSetState(p,temp2); /* update state */ p->t += DeltaT; /* update time */ }

Very simple collision response How do you decide when you’ve had a collision? A problem with this approach is that particles will disappear under the surface. Also, the response may not be enough to bring a particle to the other side of a wall. N P v1v1 x1x1 x2x2 x3x3 v2v2 v3v3

Generate Particles Particle Attributes – initial position, – initial velocity (both speed and direction), – initial size, – initial color, – initial transparency, – shape, – lifetime. WILLIAM T. REEVES, ACM Transactions on Graphics, Vol. 2, No. 2, April 1983

Generate Particles Initial Particle Distribution Particle hierarchy, for example – Skyrocket : firework – Clouds : water drops

Throwing a ball from a robot arm Let’s say we had our robot arm example and we wanted to launch particles from its tip. How would we calculate initial speed? Q=R(theta)*T1*R(phi)*T2*R(psi)*P We want dQ/dt

Principles of Animation The following are a set of principles to keep in mind: 1. Squash and stretch 2. Staging 3. Timing 4. Anticipation 5. Follow through 6. Secondary action 7. Straight-ahead vs. pose-to-pose vs. blocking 8. Arcs 9. Slow in, slow out 10. Exaggeration 11. Appeal

Squash and stretch (cont’d)

Anticipation An action has three parts: anticipation, action, reaction. Anatomical motivation: a muscle must extend before it can contract. Watch: bugs-bunny.virtualdub.new.mpg Prepares audience for action so they know what to expect. Directs audience's attention.

Anticipation (cont’d) Amount of anticipation (combined with timing) can affect perception of speed or weight.

Arcs Avoid straight lines since most things in nature move in arcs.

Slow in and slow out An extreme pose can be emphasized by slowing down as you get to it (and as you leave it). In practice, many things do not move abruptly but start and stop gradually.

Exaggeration Get to the heart of the idea and emphasize it so the audience can see it.

Exaggeration Get to the heart of the idea and emphasize it so the audience can see it.

Appeal The character must interest the viewer. It doesn't have to be cute and cuddly. Design, simplicity, behavior all affect appeal. Example: Luxo, Jr. is made to appear childlike.

Appeal (cont’d) Note: avoid perfect symmetries.

Appeal (cont’d) Note: avoid perfect symmetries.

Ray Tracing Slides are from Ravi Ramamoorthi’s graphics class at Columbia U Shirley Ch 4

Effects needed for Realism  Reflections (Mirrors and Glossy)  Transparency (Water, Glass)  Interreflections (Color Bleeding)  (Soft) Shadows  Complex Illumination (Natural, Area Light)  Realistic Materials (Velvet, Paints, Glass)  And many more Image courtesy Paul Heckbert 1983

Ray Tracing  Different Approach to Image Synthesis as compared to Hardware pipeline (OpenGL)  OpenGL : Object by Object  Ray Tracing : Pixel by Pixel  Advantage:  Easy to compute shadows/transparency/etc  Disadvantage:  Slow (in early days)

Basic Version: Ray Casting Virtual Viewpoint Virtual ScreenObjects Ray misses all objects: Pixel colored blackRay intersects object: shade using color, lights, materialsMultiple intersections: Use closest one (as does OpenGL)

Ray Casting Produce same images as with OpenGL  Visibility per pixel instead of Z-buffer  Find nearest object by shooting rays into scene  Shade it as in standard OpenGL

Comparison to hardware scan-line  Per-pixel evaluation, per-pixel rays (not scan-convert each object). On face of it, costly  But good for walkthroughs of extremely large models (amortize preprocessing, low complexity)  More complex shading, lighting effects possible

Shadows Virtual Viewpoint Virtual ScreenObjects 10.5 in textbook Light Source Shadow ray to light is unblocked: object visibleShadow ray to light is blocked: object in shadow

Shadows: Numerical Issues Numerical inaccuracy may cause intersection to be below surface (effect exaggerated in figure) Causing surface to incorrectly shadow itself Move a little towards light before shooting shadow ray

Mirror Reflections/Refractions Virtual Viewpoint Virtual ScreenObjects Generate reflected ray in mirror direction, Get reflections and refractions of objects

Recursive Ray Tracing (Core Idea) For each pixel  Trace Primary Eye Ray, find intersection  Trace Secondary Shadow Ray(s) to all light(s)  Color = Visible1 ? Illumination Model(light1) : 0 ;  Color += Visible2 ? Illumination Model(light2) : 0 ; ……  Trace Reflected Ray  Color += reflectivity * Color of reflected ray  Trace Refracted Ray  Color += transparency * Color of refracted ray Recursive function Calls

Problems with Recursion  Reflection rays may be traced forever  Generally, set maximum recursion depth

Turner Whitted 1980

Effects needed for Realism (Soft) Shadows Reflections (Mirrors and Glossy) Transparency (Water, Glass) Interreflections (Color Bleeding) Complex Illumination (Natural, Area Light) Realistic Materials (Velvet, Paints, Glass) Discussed in this lecture Not discussed so far but possible with distribution ray tracing (13.4) Hard (but not impossible) with ray tracing; radiosity methods

How to implement Ray tracing?  Ray parameterization  Ray-Surface Intersection

Ray/Object Intersections  Heart of Ray Tracer  One of the main initial research areas  Optimized routines for wide variety of primitives  Various types of info  Shadow rays: Intersection/No Intersection  Primary rays: Point of intersection, material, normals, Texture coordinates Section 10.3

Example  Sphere  How to decide there is an intersection?  Triangle  How to decide the intersection is inside?  Polygon  How to decide the intersection is inside?  How about an ellipsoid?

Ray-Tracing Transformed Objects We have an optimized ray-sphere test  But we want to ray trace an ellipsoid… Solution: Ellipsoid transforms sphere  Apply inverse transform to ray, use ray-sphere

Acceleration Testing each object for each ray is slow  Faster Intersections  Optimized Ray-Object Intersections  Fewer Intersections

Acceleration Structures Bounding boxes (possibly hierarchical) If no intersection bounding box, needn’t check objects Bounding Box Ray Different Spatial Hierarchies (Oct-trees, kd trees, BSP trees)

Octree

K-d tree