CS559: Computer Graphics Lecture 36: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.

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
12 Principle of Animation. Series of pictures of objects/characters in motion Displayed at some rate –film 24 fps –video 30 fps What is animation?
David Luebke1/19/99 CS 551/651: Advanced Computer Graphics David Luebke
Christian Lauterbach COMP 770, 2/11/2009
Graphics Korea University Computer Animation Computer Graphics.
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.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
(conventional Cartesian reference system)
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.
1/12/09 1 Introduction Computer Graphics COMP 770 (236) Spring 2009 Instructor: Dinesh Manocha.
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
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.
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.
Hidden Surface Removal
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
1 Perception and VR MONT 104S, Spring 2008 Lecture 22 Other Graphics Considerations Review.
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.
-Global Illumination Techniques
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
Foundations of Computer Graphics (Spring 2012) CS 184, Lectures 16, 18: Nuts and bolts of Ray Tracing Acknowledgements:
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 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
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.
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.
- Laboratoire d'InfoRmatique en Image et Systèmes d'information
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Monte-Carlo Ray Tracing and
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.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
RENDERING : Global Illumination
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
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.
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.
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
Presentation transcript:

CS559: Computer Graphics Lecture 36: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington

Today Particle Systems, Cartoon animation, ray tracing Reading – (Optional) John Lasseter. Principles of traditional animation applied to 3D computer animation. Proceedings of SIGGRAPH (Computer Graphics) 21(4): 35-44, July – (Optional) WILLIAM T. REEVES, ACM Transactions on Graphics, Vol. 2, No. 2, April

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 */ }

Bouncing off the walls Handling collisions is a useful add-on for a particle simulator. For now, we’ll just consider simple point-plane collisions. A plane is fully specified by any point P on the plane and its normal N. N P v x

Collision Detection How do you decide when you’ve made exact contact with the plane? N P v x

Normal and tangential velocity To compute the collision response, we need to consider the normal and tangential components of a particle’s velocity. N P v x v

Collision Response before after v’v’ The response to collision is then to immediately replace the current velocity with a new velocity: The particle will then move according to this velocity in the next timestep. v

Collision without contact In general, we don’t sample moments in time when particles are in exact contact with the surface. There are a variety of ways to deal with this problem. A simple alternative is to determine if a collision must have occurred in the past, and then pretend that you’re currently in exact contact.

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

More complicated collision response Another solution is to modify the update scheme to: – detect the future time and point of collision – reflect the particle within the time-step N P v x

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 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 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 John Lasseter. Principles of traditional animation applied to 3D computer animation. Proceedings of SIGGRAPH (Computer Graphics) 21(4): 35-44, July Goal : make characters that move in a convincing way to communicate personality and mood. Walt Disney developed a number of principles. – ~1930 Computer graphics animators have adapted them to 3D animation.

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 Squash: flatten an object or character by pressure or by its own power. Stretch: used to increase the sense of speed and emphasize the squash by contrast. Note: keep volume constant! animation/principles/squash_and_stretch.htm animation/principles/squash_and_stretch.htm animation/principles/bouncing_ball_example_of_slow_in_out.htm animation/principles/bouncing_ball_example_of_slow_in_out.htm

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 Reading: Shirley Ch

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 Section in text (we show visually, omitting math)

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 10.6 in textbook 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 = Visible ? Illumination Model : 0 ;  Trace Reflected Ray  Color += reflectivity * Color of reflected ray  Trace Refracted Ray  Color += transparency * Color of refracted ray Also see section 10.4 in text 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 (10.11) Hard (but not impossible) with ray tracing; radiosity methods

How to implement?  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 Section 10.8 of text

Acceleration Testing each object for each ray is slow  Faster Intersections  Optimized Ray-Object Intersections  Fewer Intersections Section 10.9 goes into more detail

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

Octtree

K-d tree

Acceleration Structures: Grids

Raytracing on Graphics Hardware  Modern Programmable Hardware general streaming architecture  Can map various elements of ray tracing  Kernels like eye rays, intersect etc.  In vertex or fragment programs  Convergence between hardware, ray tracing [Purcell et al. 2002, 2003]

Outline  History  Basic Ray Casting (instead of rasterization)  Comparison to hardware scan conversion  Shadows / Reflections (core algorithm)  Ray-Surface Intersection  Optimizations  Current Research Section 10 in text

Ray Tracing: History  Appel 68  Whitted 80 [recursive ray tracing]  Landmark in computer graphics  Lots of work on various geometric primitives  Lots of work on accelerations  Current Research  Real-Time raytracing (historically, slow technique)  Ray tracing architecture

Outline  History  Basic Ray Casting (instead of rasterization)  Comparison to hardware scan conversion  Shadows / Reflections (core algorithm)  Ray-Surface Intersection  Optimizations  Current Research

Outline  History  Basic Ray Casting (instead of rasterization)  Comparison to hardware scan conversion  Shadows / Reflections (core algorithm)  Ray-Surface Intersection  Optimizations  Current Research

Outline  History  Basic Ray Casting (instead of rasterization)  Comparison to hardware scan conversion  Shadows / Reflections (core algorithm)  Ray-Surface Intersection  Optimizations  Current Research

Outline  History  Basic Ray Casting (instead of rasterization)  Comparison to hardware scan conversion  Shadows / Reflections (core algorithm)  Ray-Surface Intersection  Optimizations  Current Research

Interactive Raytracing  Ray tracing historically slow  Now viable alternative for complex scenes  Key is sublinear complexity with acceleration; need not process all triangles in scene  Allows many effects hard in hardware  OpenRT project real-time ray tracing (