Animation and Ray Tracing

Similar documents
Ray Tracing. CS 4620 Lecture 5

Viewing and Ray Tracing. CS 4620 Lecture 4

Viewing and Ray Tracing

Ray Tracing COMP575/COMP770

A Little Background. Motivation. Motivation

Ray tracing idea. Ray Tracing. Ray tracing algorithm. Plane projection in drawing. CS 465 Lecture 3

Particle systems, collision detection, and ray tracing. Computer Graphics CSE 167 Lecture 17

CS4621/5621 Fall Particle Systems and Compute Shaders

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

3D Viewing. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 9

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Ray Tracing. Foley & Van Dam, Chapters 15 and 16

Ray Tracing Foley & Van Dam, Chapters 15 and 16

CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer. by Emmanuel Agu

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

CS4670: Computer Vision

Questions??? Announcements Assignment 3 due today

Announcements. Motion. Structure-from-Motion (SFM) Motion. Discrete Motion: Some Counting

3D Viewing. CS 4620 Lecture 8

Announcements. Motion. Structure-from-Motion (SFM) Motion. Discrete Motion: Some Counting

CS6670: Computer Vision

Ray Tracing: shading

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Karen Liu associate professor at School of Interactive Computing. Murali Varma graduate student at School of Interactive Computing

Computer Graphics. Lecture 02 Graphics Pipeline. Edirlei Soares de Lima.

Computer Graphics I Lecture 11

Ray Tracing. Brian Curless CSEP 557 Fall 2016

Pipeline Operations. CS 4620 Lecture 14

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6

Mass-Spring Systems. Last Time?

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Computer Animation III

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

CPSC GLOBAL ILLUMINATION

Chapter 3: Computer Animation Reminder: Descriptive animation. Procedural animation : Examples. Towards methods that generate motion?

AP Physics: Curved Mirrors and Lenses

CS559 Computer Graphics Fall 2015

CS770/870 Spring 2017 Ray Tracing Implementation

Rasterization Overview

1.2 Numerical Solutions of Flow Problems

CS Computer Graphics: Introduction to Ray Tracing

CS Computer Graphics: Introduction to Ray Tracing

Introduction to Ray-tracing Objectives

Introduction to Computer Vision

CS 130 Exam I. Fall 2015

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting

EECS 487, Fall 2005 Exam 2

Ray Tracing. CPSC 453 Fall 2018 Sonny Chan

Lecture 11: Ray tracing (cont.)

I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S

Mathematical Tools in Computer Graphics with C# Implementations Table of Contents

Volume Rendering. Computer Animation and Visualisation Lecture 9. Taku Komura. Institute for Perception, Action & Behaviour School of Informatics

Rigid Body Motion and Image Formation. Jana Kosecka, CS 482

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

Cornell CS4620 Fall 2011!Lecture Kavita Bala (with previous instructors James/Marschner) Cornell CS4620 Fall 2011!Lecture 1.

MODELING AND HIERARCHY

The jello cube. Undeformed cube. Deformed cube

Photorealism: Ray Tracing

Computer Animation. Algorithms and Techniques. z< MORGAN KAUFMANN PUBLISHERS. Rick Parent Ohio State University AN IMPRINT OF ELSEVIER SCIENCE

Sung-Eui Yoon ( 윤성의 )

Reading. Ray Tracing. Eye vs. light ray tracing. Geometric optics. Required: Watt, sections , (handout) Further reading:

Pipeline Operations. CS 4620 Lecture 10

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Light: Geometric Optics

Accelerating Geometric Queries. Computer Graphics CMU /15-662, Fall 2016

How to achieve this goal? (1) Cameras

Ray Casting. Outline. Similar to glulookat derivation. Foundations of Computer Graphics

CS-184: Computer Graphics. Administrative

CPSC 4040/6040 Computer Graphics Images. Joshua Levine

Raycasting. Chapter Raycasting foundations. When you look at an object, like the ball in the picture to the left, what do

Physically based modelling Computer Graphics I February 27, 2003

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

Massachusetts Institute of Technology Department of Computer Science and Electrical Engineering 6.801/6.866 Machine Vision QUIZ II

Figure 1. Lecture 1: Three Dimensional graphics: Projections and Transformations

Dynamical Simulation 1: Particle Systems and ODEs

Graphics Pipeline 2D Geometric Transformations

The Jello Cube Assignment 1, CSCI 520. Jernej Barbic, USC

CS4670/5760: Computer Vision Kavita Bala Scott Wehrwein. Lecture 23: Photometric Stereo

Barycentric Coordinates and Parameterization

Geometric Transformations

Visualizing Quaternions

Mathematically, the path or the trajectory of a particle moving in space in described by a function of time.

Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs)

COSC579: Scene Geometry. Jeremy Bolton, PhD Assistant Teaching Professor

Interactive Real-Time Raycasting

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52

Jorg s Graphics Lecture Notes Coordinate Spaces 1

Lahore University of Management Sciences. CS 452 Computer Graphics

Computational Photography

Geometric optics. The University of Texas at Austin CS384G Computer Graphics Don Fussell

CS4620/5620: Lecture 14 Pipeline

The Graphics Pipeline. Interactive Computer Graphics. The Graphics Pipeline. The Graphics Pipeline. The Graphics Pipeline: Clipping

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Transcription:

CS4620/5620: Lecture 33 Animation and Ray Tracing 2012 Kavita Bala 1 Announcements Quaternion problem, 3.3: 180 degrees 4621 Friday (animation): Nov 16 Plan Ray Tracing Thanksgiving Color Prelim (Thu after Thanksgiving) 2012 Kavita Bala 2

Physically-Based Motion Try to explicitly model the physics of motion Animate: human, birds Inanimate: fire, smoke, water, cloth Pro: captures reality Con: hard to control 2012 Kavita Bala 3 Physically-Based Animation Must obey laws of physics Lot harder to simulate Not just interpolation Must solve for equilibrium solutions Newtonian physics, Navier Stokes equations 2012 Kavita Bala 4

Resources Physically Based Modeling Notes http://www.pixar.com/companyinfo/research/pbm2001/ index.html Differential Equation Basics Particle Dynamics Rigid Body Dynamics 2012 Kavita Bala 5 Overview Model with physical attributes Mass, moment of inertia, elasticity, etc. Derive differential equations by applying Newtonian physics Specify initial conditions: position, velocity Specify external forces (maybe keyframe) Solve for motion 2012 Kavita Bala 6

2012 Kavita Bala 7 Ordinary Differential Equation (ODE) Have function f for derivative of x x is state x is a moving point f is known f is its velocity 2012 Kavita Bala 8

Vector Field The differential equation defines a vector field over x 2012 Kavita Bala 9 Initial Value Problem We have an initial value for x: x(t0) We want to solve for x over time How do we do it? Numerical solution 2012 Kavita Bala 10

Euler Method Move a little step along the derivative to the next position where h is the step size 2012 Kavita Bala 11 Euler Method and Step Size Simplest numerical solution Discrete time steps Bigger steps, bigger error 2012 Kavita Bala 12

Accuracy Larger stepsize h leads to larger error Representation (round off) error will cause inaccuracy 2012 Kavita Bala 13 Stability Euler method is unstable: solution might diverge!! 2012 Kavita Bala 14

Beyond Euler Euler is a first order method We can improve the accuracy of each step if we extend to second derivatives Based on Taylor series expansion Euler: only first 2 terms Error dominated by h 2 2012 Kavita Bala 15 Bottom Line Use simpler methods if they get the job done In 4621 will discuss using particle systems that include simple physics 2012 Kavita Bala 16

2012 Kavita Bala 17 2012 Kavita Bala 18

Ray Tracing 2012 Kavita Bala 19 2012 Kavita Bala 20

Ray tracing idea 2012 Kavita Bala 21 Ray tracing algorithm for each pixel { compute viewing ray intersect ray with scene compute illumination at visible point put result into image } 2012 Kavita Bala 22

Plane projection in drawing [Carlbom & Paciorek 78] 2012 Kavita Bala 23 Ray generation vs. Projection Viewing in ray tracing start with image point compute 3D point that projects to that point using ray do this using geometry Viewing by projection start with 3D point compute image point that it projects to do this using transforms Inverse processes 2012 Kavita Bala 24

Generating eye rays Use window analogy directly 2012 Kavita Bala 25 Generating eye rays Use window analogy directly viewpoint view rect view rect pixel position viewing ray pixel position viewing ray ORTHOGRAPHIC PERSPECTIVE 2012 Kavita Bala 26

Generating eye rays orthographic Just need to compute the view plane point s: s d v p = s; d = d v r(t) = p + td but where exactly is the view rectangle? 2012 Kavita Bala 27 Generating eye rays orthographic Positioning the view rectangle establish three vectors to be camera basis: u, v, w view rectangle is in u v plane, specified by l, r, t, b now ray generation is easy: s = e + uu + vv v p = s; d = w r(t) = p + td w e u 2012 Kavita Bala 28

Generating eye rays perspective View rectangle needs to be away from viewpoint Distance is important: focal length of camera still use camera frame but position view rect away from viewpoint ray origin always e ray direction now e controlled by s d = s e s p = e r(t) = p + td 2012 Kavita Bala 29 Generating eye rays perspective Compute s in the same way; just subtract dw coordinates of s are (u, v, d) s = e + uu + vv p = e; d = s e r(t) = p + td dw v w e u 2012 Kavita Bala 30

Pixel-to-image mapping One last detail: (u, v) coords of a pixel v = t u = l u = r v = b u = l + (r l)(i + 0.5)/n x v = b + (t b)(j + 0.5)/n y 2012 Kavita Bala 31 PA3A camera viewpoint == e projnormal == w, viewup == up Compute u, v from the above l = -viewwidth/2 r = +viewwidth/2 n_x = imagewidth 2012 Kavita Bala 32

Ray intersection 2012 Kavita Bala 33 Ray: a half line Standard representation: point p and direction d this is a parametric equation for the line lets us directly generate the points on the line if we restrict to t > 0 then we have a ray note replacing d with ad doesn t change ray (a > 0) 2012 Kavita Bala 34

Ray-sphere intersection: algebraic Condition 1: point is on ray Condition 2: point is on sphere assume unit sphere; see Shirley for general Substitute: this is a quadratic equation in t 2012 Kavita Bala 35 Ray-sphere intersection: algebraic Solution for t by quadratic formula: simpler form holds when d is a unit vector but don t necessarily assume this (for potential performance reasons) discriminant intuition? use the unit-vector form to make the geometric interpretation 2012 Kavita Bala 36

Ray-sphere intersection: geometric 2012 Kavita Bala 37 Normal for sphere 2012 Kavita Bala 38

Image so far With eye ray generation and sphere intersection Surface s = new Sphere((0.0, 0.0, 0.0), 1.0); for 0 <= iy < ny for 0 <= ix < nx { ray = camera.getray(ix, iy); hitsurface, t = s.intersect(ray, 0, +inf) if hitsurface is not null image.set(ix, iy, white); } 2012 Kavita Bala 39 2012 Kavita Bala 40