William Ribarsky (modified by Amos Johnson) 1 Ray Tracing.

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

13.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 13 An Introduction to Ray Tracing.
Lecture 8 Transparency, Mirroring
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
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.
3D Graphics Rendering and Terrain Modeling
Part I: Basics of Computer Graphics
May Visible Surface Detection Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
Light Issues in Computer Graphics Presented by Saleema Amershi.
Informationsteknologi Thursday, November 22, 2007Computer Graphics - Class 111 Today’s class Clipping Parametric and point-normal form of lines Intersecting.
Chapter 11: Advanced Rendering Part 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
Ray Tracing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of.
RAY TRACING.
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
Ray Tracing Jerry Sui Adam Conner. Part I – Introduction to Ray Tracing Final Product.
CS 376 Introduction to Computer Graphics 04 / 06 / 2007 Instructor: Michael Eckmann.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
CIS 310: Visual Programming, Spring 2006 Western State College 310: Visual Programming Ray Tracing.
CS 376 Introduction to Computer Graphics 04 / 04 / 2007 Instructor: Michael Eckmann.
Ray Tracing 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
Now Playing: Quicksand Under Carpet New Radiant Storm King from Leftover Blues: Released 2004.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Geometrical Optics (Lecture II)
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
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.
10.6 Equations of a Circle Standard Equation of a Circle Definition of a Circle.
Week 13 - Wednesday CS361.
5.3 Systems of Linear Equations in Three Variables
Solar potential analysis with shadowing effect. Illustrative examples of surfaces:
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.
College of Computer and Information Science, Northeastern UniversityOctober 12, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2006.
Visible-Surface Detection Jehee Lee Seoul National University.
The Quadratic Formula. What does the Quadratic Formula Do ? The Quadratic formula allows you to find the roots of a quadratic equation (if they exist)
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.
College of Computer and Information Science, Northeastern UniversityOctober 31, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2009.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
Alex YAU Important Notes Website for Assignment #2 You.
Basic Ray Tracing CMSC 435/634.
Ray Tracing. 2 Introduction OpenGL is based on a pipeline model in which primitives are rendered one at time ­No shadows (except by tricks or multiple.
VECTORS AND THE GEOMETRY OF SPACE 12. PLANES Thus, a plane in space is determined by:  A point P 0 (x 0, y 0, z 0 ) in the plane  A vector n that is.
CS 480/680 Computer Graphics Compositing and Blending Dr. Frederick C Harris, Jr.
CSCE 441: Computer Graphics Ray Tracing
CS 551/651: Advanced Computer Graphics
More on Ray Tracing Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, April 14, 2004.
RENDERING : Global Illumination
Ray Tracing I. Reading Hill, Chapter 14, Sections 14.1 to 14.5 Hill, Chapter 14, Sections and
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.
CS 376 Introduction to Computer Graphics 04 / 18 / 2007 Instructor: Michael Eckmann.
Discrete Math Section 12.5 Apply vectors in three dimensions Given points A(x 1,y 1,z 1 ) and B(x 2,y 2,z 2 ) Vector = Absolute value of = √((x 2 – x 1.
Extended Work on 3D Lines and Planes. Intersection of a Line and a Plane Find the point of intersection between the line and the plane Answer: (2, -3,
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
Solving Linear Systems
Using the Quadratic Formula to Find Solutions
Introduction to Computer Graphics with WebGL
CS G140 Graduate Computer Graphics
Ray Tracing Ed Angel Professor Emeritus of Computer Science
Ray Tracing Forward Ray Tracing
Planes in Space.
Intersecting Simple Surfaces
3D Graphics Rendering PPT By Ricardo Veguilla.
RAY TRACING.
Introduction to Computer Graphics with WebGL
Ray Tracing.
Objective Solve quadratic equations by using square roots.
CS 655 – Advanced Computer Graphics
GR2 Advanced Computer Graphics AGR
Presentation transcript:

William Ribarsky (modified by Amos Johnson) 1 Ray Tracing

William Ribarsky (modified by Amos Johnson) 2 Ray Tracing Trace light rays that enter eye through view-plane back from whence they came. (# rays == # pixels) Use illumination model to determine color at intersection of ray and object. Shadows “happen”. Light Source Center of Projection Projection Plane Shadow Ray

William Ribarsky (modified by Amos Johnson) 3 BASIC RAY TRACING 1. Find intersection of ray with nearest object in scene (Eye ray). 2. Determine if that object is in shadow relative to light source(s). (Shadow ray(s)). 3. Determine illumination of object from light source(s). A LARGE part of the work is in calculating intersections. Performance can be improved by making intersection calculations more efficient or by avoiding unnecessary intersection calculations.

William Ribarsky (modified by Amos Johnson) 4 Ray/Plane Intersection Ray is defined by R(t) = R0 + Rd*t where t > 0 R0 = Origin of ray at (x0, y0, z0) Rd = Direction of ray [xd, yd, zd] unit vector Plane is defined by [A, B, C, D] Ax + By + Cz + D = 0 for a point in the plane A 2 + B 2 + C 2 = 1 Normal Vector, N = [A, B, C]

William Ribarsky (modified by Amos Johnson) 5 Ray/Plane (cont.) Substitute the ray equation into the plane equation: A(x0 + xd*t ) + B(y0 + yd*t) + C(z0 +zd*t) + D = 0 Solve for t: t = - (Ax0 + By0 + Cz0 + D) / ( Axd + Byd + Czd) or t = - ( N R0 + D) / ( N Rd) Note: The normal vector of the plane should usually (except for backface removal) be for the surface facing the ray. If it isn't then you should reverse it. If N Rd > 0 Then use -[A, B, C]

William Ribarsky (modified by Amos Johnson) 6 Ray/Plane (cont.) If N·Rd = 0, then the ray and plane are parallel and don’t intersect To Determine if the intersection point lies in the polygon –Project the 3D plane onto a 2D surface, by remove the dimension with the largest absolute value in the plane equation –Use the “inside/outside” test for 2D polygons to determine if the point lies inside or outside.

William Ribarsky (modified by Amos Johnson) 7 Ray/Sphere Intersection Ray is defined by R(t) = R0 + Rd*t where t > 0 R0 = Origin of ray at (x0, y0, z0) Rd = Direction of ray [xd, yd, zd] unit vector A sphere with center (a, b, c) and radius r may be represented by (x - a) 2 + (y - b) 2 + (z - c) 2 - r 2 = 0

William Ribarsky (modified by Amos Johnson) 8 Solving for t Substitute the basic ray equation x = x0 + xd*t y = y0 + yd*t z = z0+ zd*t into the equation of the sphere (x0 + xd*t - a) 2 + (y0 + yd*t - b) 2 + (z0 +zd*t - c) 2 - r 2 = 0 This is a quadratic equation in t! A*t 2 + B*t + C = 0 where A = (xd) 2 + (yd) 2 + (zd) 2 B = 2[xd (x0 - a) + yd (y0 - b) + zd ( z0 - c)] C = (x0 - a) 2 + (y0 - b) 2 + (z0 - c) 2 - r 2

William Ribarsky (modified by Amos Johnson) 9 Solving for t (cont.) 1.If there are no real roots, then the ray and sphere do not intersect 2.If there is only one real root, then the ray grazes the sphere 3.If there are two real roots, then the ray intersects the sphere –The root that gives the smallest positive t is the closet intersection point