Ray Tracing Forward 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.
William Ribarsky (modified by Amos Johnson) 1 Ray Tracing.
CSC418 Computer Graphics n Polygon normals n Back Faces n Visibility Algorithms.
Light Issues in Computer Graphics Presented by Saleema Amershi.
MC930/MO603 Ray Casting. Light is bouncing photons.
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.
CS 376 Introduction to Computer Graphics 04 / 04 / 2007 Instructor: Michael Eckmann.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
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.
Vectors and the Geometry of Space
What is Computer Graphics and Image Processing? lAll visual computer output depends on computer graphics and image processing. l3D computer graphics is.
Advanced Rendering University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Solar potential analysis with shadowing effect. Illustrative examples of surfaces:
Computer graphics & visualization Ray-Tracing – A Quick review.
COMP 175: Computer Graphics March 24, 2015
1 Ray Casting. CLASS 1 Ray Casting 2 3 Overview of Today Ray Casting Basics Camera and Ray Generation Ray-Plane Intersection.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Ray Tracing.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
Alex YAU Important Notes Website for Assignment #2 You.
Basic Ray Tracing CMSC 435/634.
Computer Graphics Lecture 08 Fasih ur Rehman. Last Class Ray Tracing.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
3D Object Representations graphics scenes contain solid geometric objects trees, flowers, clouds, rocks, water representations surface ↔interior models.
Volume and Solid Modeling
Cylinders and Quadric Surfaces
11.6 Surfaces in Space.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Lighting Lighting.
RENDERING : Global Illumination
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Ray Tracing I. Reading Hill, Chapter 14, Sections 14.1 to 14.5 Hill, Chapter 14, Sections and
Basic Ray Tracing CMSC 435/634.
3D Rendering 2016, Fall.
Advanced Computer Graphics
CSE 167 [Win 17], Lecture 15: Ray Tracing Ravi Ramamoorthi
Introduction to Computer Graphics with WebGL
Hidden Surface Removal
CS G140 Graduate Computer Graphics
Ray Tracing Ed Angel Professor Emeritus of Computer Science
Chapter 12 Math 181.
MIT EECS 6.837, Cutler and Durand
CENG 538 Advanced Graphics and UIs
Intersecting Simple Surfaces
Prof. Harriet Fell Spring 2007 Lecture 26 – March 19, 2007
3D Graphics Rendering PPT By Ricardo Veguilla.
Ray Tracing Geometry CSE 681.
RAY TRACING.
Sign name list.
Ray Tracing Geometry CSE 681.
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Ray Tracing.
Introduction to Computer Graphics with WebGL
Ray Tracing.
Digital Image Synthesis Yung-Yu Chuang 10/4/2005
Clip against view volume Project onto projection plane
Object Intersection CSE 681.
Object Intersection CSE 681.
Image synthesis using classical optics
Image.
CS 655 – Advanced Computer Graphics
GR2 Advanced Computer Graphics AGR
Digital Image Synthesis Yung-Yu Chuang 10/04/2007
Simple Ray-Based Rendering
GPAT – Chapter 7 Physics.
Presentation transcript:

Ray Tracing Forward Ray Tracing Modeling interaction of light with the objects/surfaces Problem: Many rays will not contribute to the image!

Ray Tracing Backward Ray Tracing Rays from camera (viewer) through each pixel to the scene Backward Ray Tracing = Ray Tracing

Primary and Secondary Rays Ray Tracing Backward Ray Tracing Primary and Secondary Rays D B Viewer E C A View Plane F

Ray Tracing Backward Ray Tracing Shadow Rays Visibility check with respect to the light source

Ray Tracing Ray Casting D B Viewer E C A View Plane F

Ray Tracing Two Issues Ray-object intersection Visibility test: Closest to the viewer Pixel color determination (shading) Illumination model

Ray Tracing Ray Object Intersection Sphere Rd Ro

Ray Tracing Ray Object Intersection Sphere Implicit Form Center Sc = [ Xc Yc Zc ] Radius Sr Surface Point [ Xs Ys Zs ]

Ray Tracing Ray Object Intersection Sphere To solve the intersection problem the ray equation is substituted into the sphere equation and the result is solved for t That is

Ray Tracing Ray Object Intersection Sphere

[ Xi Yi Zi ] = [ Xo + Xdt , Yo + Ydt , Zo + Zdt ] Ray Tracing Ray Object Intersection Sphere Smaller positive among t0 and t1 gives the closest intersection point [ Xi Yi Zi ] = [ Xo + Xdt , Yo + Ydt , Zo + Zdt ]

Ray Tracing Ray Object Intersection Sphere Normal

Ray Tracing Ray Sphere Intersection Sum up Calculate A B C Compute the discriminant Calculate min (t0 , t1) Compute the intersection point Compute the normal

Ray Tracing Ray Object Intersection Sphere Geometric Approach tca thc Rd d r R0 L O

Ray Tracing Ray Object Intersection Sphere Geometric Approach tca thc Rd d r R0 L O

Ray Tracing Ray Object Intersection Sphere Geometric Approach tca thc Rd d r R0 L O

Ray Tracing Ray Object Intersection Sphere Geometric Approach tca thc Rd d r R0 L O

Ray Tracing Ray Plane Intersection Ray Ro = [ Xo Yo Zo ] (ray origin) Rd = [ Xd Yd Zd ] (ray direction) Xd2 + Yd2 + Zd2 =1 (normalized) R(t) = Ro + Rdt t > 0 Plane P : Ax + By + Cz + D = 0 A2 + B2 +C2 = 1 Pnormal = Pn = [ A B C ] D : Distance from origin

Ray Tracing Ray Plane Intersection Substituting ray equation in plane’s equation A ( Xo + Xdt ) + B (Yo + Ydt ) + C ( Zo + Zdt ) + D = 0 Solving for t

Ray Tracing Ray Plane Intersection Let If Vd = 0 then the ray is parallel to the plane (no intersection) Vd > 0 normal is pointing away from the ray (may be used for back-face culling) Normal Ray

Ray Tracing Ray Plane Intersection Let If t < 0 then plane is behind ray’s origin else compute intersection ri = [ Xi Yi Zi ] = [Xo + Xdt , Yo + Ydt , Zo + Zdt ] rnormal = Pn Let

Ray Tracing Polygon Intersection Containment Test Parity Test: If the number of intersection is odd then point is inside (special case for vertices)

Triangle: Barycentric Coordinates Ray Tracing Triangle Intersection Containment Test Triangle: Barycentric Coordinates V3 P V1 V2

Triangle: Barycentric Coordinates Ray Tracing Triangle Intersection Containment Test Triangle: Barycentric Coordinates V3 A2 P A1 Total A V1 V2 A3 Area Coordinates

Triangle: Barycentric Coordinates Ray Tracing Triangle Intersection Containment Test Triangle: Barycentric Coordinates V3 A2 A1 P V1 V2 A3

Ray Tracing Ray Quadric Intersection Quadrics: Cylinders, Cone, Sphere, Ellipsoids, Paraboloids, Hyperboloids, etc. Implict form f(X,Y,Z) = 0 Ax2 + 2Bxy + 2Cxz + 2Dx + Ey2 +2Fyz +26y + Hz2 + 2Iz +J = 0 Ray: Parametric form Ro = [ Xo Yo Zo ] (ray origin) Rd = [ Xd Yd Zd ] (ray direction) Xd2 + Yd2 + Zd2 =1 (normalized) R(t) = Ro + Rdt t > 0

Ray Tracing Ray Quadric Intersection Matrix Form f(X,Y,Z) = 0

Ray Tracing Ray Quadric Intersection Substituting

Ray Tracing Ray Quadric Intersection Normal

3D Clipping: Cyrus Beck/Liang Barsky Ray Tracing Ray Box Intersection 3D Clipping: Cyrus Beck/Liang Barsky