CS 551/651: Advanced Computer Graphics

Slides:



Advertisements
Similar presentations
Everything you ever wanted to know about collision detection
Advertisements

Chapter 10 Quadratic Relations.
GR2 Advanced Computer Graphics AGR
William Ribarsky (modified by Amos Johnson) 1 Ray Tracing.
Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
CSE 681 Bounding Volumes. CSE 681 Bounding Volumes Use simple volume enclose object(s) tradeoff for rays where there is extra intersection test for object.
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Geometry Primer Lines and rays Planes Spheres Frustums Triangles Polygon Polyhedron.
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.
Ray Polygon Interception: Cyrus Beck Algorithm Mengxia Zhu Fall 2007.

Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Christian Lauterbach COMP 770, 2/11/2009
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
CS 376 Introduction to Computer Graphics 04 / 06 / 2007 Instructor: Michael Eckmann.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
CS 376 Introduction to Computer Graphics 04 / 04 / 2007 Instructor: Michael Eckmann.
CSE 681 Object Intersection. CSE 681 Object Representation Implicit forms F(x,y,z) = 0 Explicit forms Analytic form x = F(y,z) testing generating Parametric.
Solving Systems of Equations Algebraically
Images in Concave Mirrors. Properties  The mirror has a reflecting surface that curves inward.  When you look at objects in the mirror, the image appears.
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.
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.
Week 13 - Wednesday CS361.
Computer Graphics Mirror and Shadows
Direct Illumination with Lazy Visibility Evaluation David Hart Philip Dutré Donald P. Greenberg Cornell University SIGGRAPH 99.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Computer graphics & visualization Ray-Tracing – A Quick review.
Systems of Nonlinear Equations in Two Variables
Introduction A system of equations is a set of equations with the same unknowns. A quadratic-linear system is a system of equations in which one equation.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Images in Concave Mirrors. Properties  The mirror has a reflecting surface that curves inward.  When you look at objects in the mirror, the image appears.
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
1 Ray Tracing Polyhedra ©Anthony Steed
1 Ray Casting. CLASS 1 Ray Casting 2 3 Overview of Today Ray Casting Basics Camera and Ray Generation Ray-Plane Intersection.
David Luebke10/9/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
CS 325 Introduction to Computer Graphics 04 / 26 / 2010 Instructor: Michael Eckmann.
College of Computer and Information Science, Northeastern UniversityOctober 12, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2006.
Week 13 - Friday.  What did we talk about last time?  Ray/sphere intersection  Ray/box intersection  Slabs method  Line segment/box overlap test.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
WARM UP WHAT TO EXPECT FOR THE REST OF THE YEAR 4 May The Discriminant May 29 Chapter Review May 30 Review May 31 Chapter 9 Test June Adding.
CS 376 Introduction to Computer Graphics 04 / 02 / 2007 Instructor: Michael Eckmann.
MIT EECS 6.837, Cutler and Durand 1 Ray Casting II.
CSCE 441: Computer Graphics Ray Tracing
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part III Intersections.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Lighting Lighting.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
David Luebke2/23/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
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.
CSE 681 Object Intersection. CSE 681 Object Representation Implicit forms F(x,y,z) = 0 Explicit forms Analytic form x = F(y,z) testing generating Parametric.
Reflection of Light Reflection – the turning back of an electromagnetic wave at the surface of a substance.
CS 376 Introduction to Computer Graphics 04 / 18 / 2007 Instructor: Michael Eckmann.
Computer Graphics Lecture 21 Triangles and Planes Taqdees A
Photorealistic Rendering vs. Interactive 3D Graphics
CS G140 Graduate Computer Graphics
Intersecting Simple Surfaces
Jim X. Chen George Mason University
© University of Wisconsin, CS559 Fall 2004
CMSC 635 Ray Tracing.
2.5. Basic Primitive Intersection
CS 551 / 645: Introductory Computer Graphics
Solving Simultaneous equations by the Graphical Method
Presentation transcript:

CS 551/651: Advanced Computer Graphics Accelerating Ray Tracing David Luebke 1 4/27/2017

Ray-Sphere Intersection Ray R = O + tD x = Ox + t * Dx y = Oy + t * Dy z = Oz + t * Dz Sphere at (l, m, n) of radius r is: (x - l)2 + (y - m)2 + (z - n)2 = r 2 Substitute for x,y,z and solve for t… David Luebke 2 4/27/2017

Ray-Sphere Intersection Works out as a quadratic equation: at2 + bt + c = 0 where a = Dx2 + Dy2 + Dz2 b = 2Dx (Ox - l) + 2Dy (Oy - m) + 2Dz (Oz - n) c = l2 + m2 + n2 + Ox2 + Oy2 + Oz2 - 2(l Ox + m Oy + n Oz + r2) David Luebke 3 4/27/2017

Ray-Sphere Intersection If solving for t gives no real roots: ray does not intersect sphere If solving gives 1 real root r, ray grazes sphere where t = r If solving gives 2 real roots (r1, r2), ray intersects sphere at t = r1 & t = r2 Ignore negative values Smallest value is first intersection David Luebke 4 4/27/2017

Ray-Sphere Intersection Find intersection point Pi = (xi, yi, zi) by plugging t back into ray equation Find normal at intersection point by subtracting sphere center from Pi and normalizing: (When might we need the normal? When not?) David Luebke 5 4/27/2017

Ray-Polygon Intersection Polygons are the most common model representation (Why?) Basic approach: Find plane equation of polygon Find intersection of ray and plane Does polygon contain intersection point? David Luebke 6 4/27/2017

Ray-Polygon Intersection Find plane equation of polygon: ax + by + cz + d = 0 How? N = [a, b, c] d = N  P1 (How to find N ?) x y N P1 P2 d David Luebke 7 4/27/2017

Ray-Polygon Intersection Find intersection of ray and plane: t = -(aOx + bOy + cOz + d) / (aDx + bDy + cDz) Does poly contain intersection point Pi ? Book’s algorithm: Draw line from Pi to each polygon vertex Measure angles between lines (how?) If sum of angles between lines is 360°, polygon contains Pi David Luebke 8 4/27/2017

Ray-Box Intersection Often want to find whether a ray hits an axis-aligned box (Why?) One way: Intersect the ray with the pairs of parallel planes that form the box If the intervals of intersection overlap, the ray intersects the box. David Luebke 9 4/27/2017

Shadow Ray Problems: Too Much Computation Light buffer (Haines/Greenberg, 86) Precompute lists of polygons surrounding light source in all directions Sort each list by distance to light source Now shadow ray need only be intersected with appropriate list! Shadow Ray Light Buffer Occluding Polys Current Intersection Point David Luebke 10 4/27/2017

Shadow Ray Problems: Sharp Shadows Why are the shadows sharp? A: Infinitely small point light sources What can we do about it? A: Implement area light sources How? David Luebke 11 4/27/2017

Shadow Ray Problems: Area Light Sources Could trace a conical beam from point of intersection to light source: Track portion of beam blocked by occluding polygons: 30% blockage David Luebke 12 4/27/2017

Shadow Ray Problems: Area Light Sources Too hard! Approximate instead: Sample the light source over its area and take weighted average: 50% blockage David Luebke 13 4/27/2017

Shadow Ray Problems: Area Light Sources Disadvantages: Less accurate (50% vs. 30% blockage) Oops! Just quadrupled (at least) number of shadow rays Moral of the story: Soft shadows are very expensive in ray tracing David Luebke 14 4/27/2017

The End David Luebke 15 4/27/2017