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.

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 14 Illumination II – Global Models
3D Graphics Rendering and Terrain Modeling
The Radiance Equation Mel Slater. Outline Introduction Light Simplifying Assumptions Radiance Reflectance The Radiance Equation Traditional Rendering.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
Light Issues in Computer Graphics Presented by Saleema Amershi.
Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
Informationsteknologi Thursday, November 22, 2007Computer Graphics - Class 111 Today’s class Clipping Parametric and point-normal form of lines Intersecting.
Christian Lauterbach COMP 770, 2/11/2009
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.
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.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
Ray Tracing Jerry Sui Adam Conner. Part I – Introduction to Ray Tracing Final Product.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
Ray Tracing 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
CSC418 Computer Graphics n Raytracing n Shadows n Global Illumination.
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
12/05/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling Very brief intro to global illumination.
-Global Illumination Techniques
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
1 10/24/ :01 UML Graphics II Shadows Session 4.
111/17/ :21 Graphics II Global Rendering and Radiosity Session 9.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Basic Ray Tracing CMSC 435/634.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
CS 480/680 Computer Graphics Compositing and Blending Dr. Frederick C Harris, Jr.
Constructive Solid Geometry Ray Tracing CSG Models
1 Ray Tracing Lecture 10 © Jeff Parker, Nov 2009.
CSCE 441: Computer Graphics Ray Tracing
In the name of God Computer Graphics. Last Time Some techniques for modeling Today Global illumination and raytracing.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Radiosity Radiosity.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
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.
Chapter 1 Graphics Systems and Models Models and Architectures.
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.
CS552: Computer Graphics Lecture 33: Illumination and Shading.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
CS552: Computer Graphics Lecture 36: Ray Tracing.
Computer Graphics: Illumination
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
3D Rendering 2016, Fall.
Introduction to Computer Graphics with WebGL
Ray Tracing Ed Angel Professor Emeritus of Computer Science
3D Graphics Rendering PPT By Ricardo Veguilla.
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Illumination and Shading
Advanced Computer Graphics
GR2 Advanced Computer Graphics AGR
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CS 480/680 Computer Graphics Shading.
Presentation transcript:

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 renderings) ­No multiple reflections Global approaches ­Rendering equation ­Ray tracing ­Radiosity

3 Ray Tracing Follow rays of light from a point source Can account for reflection and transmission

4 Computation Should be able to handle all physical interactions Ray tracing paradigm is not computational Most rays do not affect what we see Scattering produces many (infinite) additional rays Alternative: ray casting

5 Ray Casting Only rays that reach the eye matter Reverse direction and cast rays Need at least one ray per pixel

6 Ray Casting Quadrics Ray casting has become the standard way to visualize quadrics which are implicit surfaces in CSG systems Constructive Solid Geometry ­Primitives are solids ­Build objects with set operations ­Union, intersection, set difference

7 Ray Casting a Sphere Ray is parametric Sphere is quadric Resulting equation is a scalar quadratic equation which gives entry and exit points of ray (or no solution if ray misses)

8 Shadow Rays Even if a point is visible, it will not be lit unless we can see a light source from that point Cast shadow or feeler rays

9 Reflection Must follow shadow rays off reflecting or transmitting surfaces Process is recursive

10 Reflection and Transmission

11 Ray Trees

12 Ray Tree

13 Diffuse Surfaces Theoretically the scattering at each point of intersection generates an infinite number of new rays that should be traced In practice, we only trace the transmitted and reflected rays but use the Phong model to compute shade at point of intersection Radiosity works best for perfectly diffuse (Lambertian) surfaces

14 Building a Ray Tracer Best expressed recursively Can remove recursion later Image based approach ­For each ray ……. Find intersection with closest surface ­Need whole object database available ­Complexity of calculation limits object types Compute lighting at surface Trace reflected and transmitted rays

15 When to stop Some light will be absorbed at each intersection ­Track amount left Ignore rays that go off to infinity ­Put large sphere around problem Count steps

16 Recursive Ray Tracer color c = trace(point p, vector d, int step) { color local, reflected, transmitted; point q; normal n; if(step > max) return(background_color);

17 Recursive Ray Tracer q = intersect(p, d, status); if(status==light_source) return(light_source_color); if(status==no_intersection) return(background_color); n = normal(q); r = reflect(q, n); t = transmit(q,n);

18 Recursive Ray Tracer local = phong(q, n, r); reflected = trace(q, r, step+1); transmitted = trace(q,t, step+1); return(local+reflected+ transmitted);

19 Computing Intersections Implicit Objects ­Quadrics Planes Polyhedra Parametric Surfaces

20 Implicit Surfaces Ray from p 0 in direction d p(t) = p 0 +t d General implicit surface f(p) = 0 Solve scalar equation f(p(t)) = 0 General case requires numerical methods

21 Quadrics General quadric can be written as p T Ap + b T p +c = 0 Substitute equation of ray p(t) = p 0 +t d to get quadratic equation

22 Sphere (p – p c ) (p – p c ) – r 2 = 0 p(t) = p 0 +t d p 0 p 0 t p 0 (d – p 0 ) t + (d – p 0 ) (d – p 0 ) – r 2 = 0

23 Planes p n + c = 0 p(t) = p 0 +t d t = -(p 0 n + c)/ d n

24 Polyhedra Generally we want to intersect with closed objects such as polygons and polyhedra rather than planes Hence we have to worry about inside/outside testing For convex objects such as polyhedra there are some fast tests

25 Ray Tracing Polyhedra If ray enters an object, it must enter a front facing polygon and leave a back facing polygon Polyhedron is formed by intersection of planes Ray enters at furthest intersection with front facing planes Ray leaves at closest intersection with back facing planes If entry is further away than exit, ray must miss the polyhedron

26 Ray Tracing Polyhedra

27 Ray Tracing a Polygon

28 Ray Tracing a Polygon