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.

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.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
3D Graphics Rendering and Terrain Modeling
Light Issues in Computer Graphics Presented by Saleema Amershi.
Illumination Model & Surface-rendering Method 박 경 와.
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.
Now Playing: Melody Day Caribou from Andorra Released August 21, 2007.
Parallelizing Raytracing Gillian Smith CMPE 220 February 19 th, 2008.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 14: Ray Tracing
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
CIS 310: Visual Programming, Spring 2006 Western State College 310: Visual Programming Ray Tracing.
1Notes. 2 Time integration for particles  Back to the ODE problem, either  Accuracy, stability, and ease-of- implementation are main issues  Obviously.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 2: Basic Ray Tracing Ravi Ramamoorthi Some slides courtesy.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
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.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
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.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
Presentation by Dr. David Cline Oklahoma State University
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.
CS 376 Introduction to Computer Graphics 04 / 11 / 2007 Instructor: Michael Eckmann.
Project Raytracing. Content Goals Idea of Raytracing Ray Casting – Therory – Practice Raytracing – Theory – Light model – Practice Output images Conclusion.
Ray Tracing Sang Il Park SEjong University With lots of slides stolen from Jehee Lee, Doug James, Steve Seitz, Shree Nayar, Alexei Efros, Fredo Durand.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
CSC418 Computer Graphics n BSP tree n Z-Buffer n A-buffer n Scanline.
The Fundamentals of Ray-Tracing Szirmay-Kalos László Dept. of Control Engineering and Information Technology Budapest University of Technology
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
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 Andries van Dam October 30, 2003 Shading 1/35 CIS 736 Computer Graphics Lecture 17 of 42 Illumination.
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.
Ray Tracer Spring 2008 Help Session. Outline Project Web Resources What do you have to do for this project? Ray Class Isect Class Requirements Tricks.
Alex YAU Important Notes Website for Assignment #2 You.
Basic Ray Tracing CMSC 435/634.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
CS380: Computer Graphics Distributed Ray Tracing TA Course URL:
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Ray Tracing II. HW1 Part A due October 10 Camera module Object module –Read from a file –Sphere and Light only Ray tracer module: –No shading. No reflection.
Advanced topics Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2006/01/04 with slides by Brian Curless, Zoran Popovic, Mario Costa Sousa.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
Project 3 Help Session: Ray Tracing. Getting Started Download the starter pack. 1.sample_ray.exe 2.ray-skel directory 3.scenes directory Look at the Road.
More on Ray Tracing Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, April 14, 2004.
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.
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
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
Review Ray Tracing III Review. Pseudo codes RayCast-1  Plain ray caster (direct illumination) RayCast-2  RayCast-1 + shadow rays RayTrace-1  Recursive.
Ray Tracer Help Session. Outline Introduction ray vec.h and mat.h isect Requirements Tips and Tricks Memory Leaks Artifact Requirement Ray Tracing Surface.
Basic Ray Tracing CMSC 435/634.
Advanced Computer Graphics
CSE 167 [Win 17], Lecture 15: Ray Tracing Ravi Ramamoorthi
Photorealistic Rendering vs. Interactive 3D Graphics
Ray Tracer Spring 2007 Help Session.
Ray Tracing Forward Ray Tracing
© University of Wisconsin, CS559 Fall 2004
Ray Tracer Project CSE 557.
Ray Tracing.
Image synthesis using classical optics
Ray Tracer Spring 2004 Help Session.
GR2 Advanced Computer Graphics AGR
Ray Tracer Project CSE 557.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Ray Tracer Autumn 2005 Help Session.
Ray Tracer Spring 2006 Help Session.
Presentation transcript:

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 intersection, x. } If x exists { For each light source { For all other objects { Check for intersection of ray from light to x. } If no intersection { Calculate direct illumination with Phong model. } Accumulate calculated color. } Calculate reflection ray r’, and recurse calling trace( r’ ) Accumulate reflected colors, and return. }

Leverage C++ Using C++ will make complicated code very simple. Take advantage of it! Abstract base class “Object”. Subclasses for spheres, triangles, etc. Store objects as array of pointers, and iterate with virtual “Intersect” function. –Common information (Kd, Ks, Ka) Each actual object type will have its own intersection function.

Data Structures Sphere: center, radius Ellipsoid: Just sphere with 4x4 tranformation applied to it. Triangle: vertices, normal Ray: start, direction Input files: –Can use parser from As3 –Need: camera information, object information Objects should at least have Ks, Kd, color, location, but the assignment is open-ended. E.g., can have Ka if you want, or not. Can have texture map information.

Parametric ray equation: r(t)=p+td –t>=0 Implicit sphere equation: f(p)=||p-c||-r=0 –p is any point on sphere’s surface, c is the center, r is the radius. –Intersection (with an implicit equation) is just root finding. Explicit triangle equation: t(u,v)=(1-u-v)v 0 +uv 1 +vv 2 –Barycentric –Solve linear system of equations. Intersections

Ellipsoids (from www- courses.cs.uiuc.edu/~cs419/ray-intersection.ppt) Intersections (More) These eqns should be flipped

Local Illumination (a quick reminder) Phong illumination model (not to be confused with Phong shading) –For each light:

Speeding things up BSP trees with bounding boxes –Intersections take up most of the time. –If create BSP structure, then can check for intersection from front to back from a given starting ray location. Octrees –Figure out which cells it intersects, and check for intersections only with objects inside those cells

More features Here are some suggestions: –Transparency with refraction –Anti-aliasing –Lens effects / depth of field –Super quadrics –Programmable shading –Texture, bump, and/or displacement mapping –Spot lights and/or area lights –Other interesting features

Tips Make sure you test your code early and often. Ray tracers are hard to debug. –Don’t try to implement everything at once. E.g., start with only spheres, 1 light source, and a constant local illumination value to test your intersection code. –Take advantage of the newsgroup. This assignment is open-ended. However, we strongly suggest using C++. Very strongly. Start now! You don’t know what silly problems you’ll encounter. Plus, you’ll get really into it and want to add lots of extra features.