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
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Advertisements

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.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
Part I: Basics of Computer Graphics
Shadow Rendering Techniques A point is in the shadow of a light source if it can not be “seen” by the light source, i.e. the line segment that connects.
Christian Lauterbach COMP 770, 2/11/2009
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 Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
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
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
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.
Hidden Surface Removal
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
What is Computer Graphics and Image Processing? lAll visual computer output depends on computer graphics and image processing. l3D computer graphics is.
COMP 175: Computer Graphics March 24, 2015
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.
Ray Tracing Sang Il Park SEjong University With lots of slides stolen from Jehee Lee, Doug James, Steve Seitz, Shree Nayar, Alexei Efros, Fredo Durand.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
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:
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
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.
Duy & Piotr. How to reconstruct a high quality image with the least amount of samples per pixel the least amount of resources And preserving the image.
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.
Bounding Volume Hierarchy. The space within the scene is divided into a grid. When a ray travels through a scene, it only passes a few boxes within the.
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.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
CS559: Computer Graphics Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008.
More on Ray Tracing Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, April 14, 2004.
RENDERING : Global Illumination
CSE 681 Introduction to Ray Tracing. CSE 681 Ray Tracing Shoot a ray through each pixel; Find first object intersected by ray. Image plane Eye Compute.
David Luebke3/12/2016 Advanced Computer Graphics Lecture 3: More Ray Tracing David Luebke
CS559: Computer Graphics Lecture 36: Raytracing Li Zhang Spring 2008 Many Slides are from Hua Zhong at CUM, Paul Debevec at USC.
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.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
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
Distributed Ray Tracing
© University of Wisconsin, CS559 Fall 2004
Lecture 36: Animation Li Zhang Spring 2008
(c) 2002 University of Wisconsin
Distributed Ray Tracing
(c) 2002 University of Wisconsin
Anti-aliased and accelerated ray tracing
Distributed Ray Tracing
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

Acceleration Structures: Grids

Anti-aliasing  Aliasing when drawing a diagonal on a square grid:  stairstepping  AKA jaggies  Especially noticeable:  high-contrast edges  near horizontal or near vertical  As line rotates (in 2D)  steps change length  corners of steps slide along the edge  known as crawlies

Supersampling  A more popular method (although less elegant) is supersampling:  Point sample the pixel at several locations  Combine the results into the final pixel color  By sampling more times per pixel:  Raises the sampling rate  Raises the frequencies we can capture  Commonly use 16 or more samples per pixel  Requires potentially 16 times as much work to generate image  16 times Memory?  A brute-force approach  But straightforward to implement  Very powerful

Moiré Artifact

Random Sampling  Supersample at several randomly located points  Breaks up repeating signals  Eliminates Moir é patterns  Instead of aliasing, frequencies greater than 1 pixel appear as noise in the image  Noise tends to be less objectionable to the viewer than jaggies or Moir é patterns  The human eye is pretty good at filtering out noise  But suffers from potential clustering and gaps  Result is not necessarily accurate  Too much noise.

Jittered Sampling  AKA stratified sampling,  Divide pixel into a grid of subpixels  Sample each subpixel at a random location  Combines the advantages of both uniform and random sampling  filters high frequencies  frequencies greater than subpixel sampling rate turned into noise  Commonly used

Soft shadow penumbra

Soft Shadow

Comparison

Glossy Surface

Vertical vs Horizonal roughness

Ray tracing a glossy surface

Ray tracing a glossy surface

Depth of Field

aperture sensor Focal plane

Depth of Field aperture sensor Focal plane

Depth of Field in OpenGL

 Render an image at each jittered location  Then average the images

Motion Blur  Ray trace a moving scene at different time instance and average the images

Motion Blur in OpenGL  Render a moving scene at different time instance  Average the images (using Accumulation buffer)

Ray tracing examples