CS 325 Introduction to Computer Graphics 04 / 09 / 2010 Instructor: Michael Eckmann.

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.
Lecture 14 Illumination II – Global Models
CS 376b Introduction to Computer Vision 04 / 21 / 2008 Instructor: Michael Eckmann.
Advanced Effects CMSC 435/634. General Approach Ray Tracing – Shoot more rays Rasterization – Render more images.
CLASS 9 ADVANCE RENDERING RAY TRACING RADIOSITY LIGHT FIELD CS770/870.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
May Visible Surface Detection Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
David Luebke1/19/99 CS 551/651: Advanced Computer Graphics David Luebke
Light Issues in Computer Graphics Presented by Saleema Amershi.
Course Website: Computer Graphics 18: Ray-tracing.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
RAY TRACING.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
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 03 / 26 / 2007 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 04 / 06 / 2007 Instructor: Michael Eckmann.
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.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
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.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 04 / 11 / 2007 Instructor: Michael Eckmann.
-Global Illumination Techniques
Project Raytracing. Content Goals Idea of Raytracing Ray Casting – Therory – Practice Raytracing – Theory – Light model – Practice Output images Conclusion.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 04 / 26 / 2010 Instructor: Michael Eckmann.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
College of Computer and Information Science, Northeastern UniversityOctober 18, CS5310 Graduate Computer Graphics Prof. Harriet Fell Spring 2011.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Ray Tracing.
1 Dr. Scott Schaefer Ray Tracing. 2/42 Ray Tracing Provides rendering method with  Refraction/Transparent surfaces  Reflective surfaces  Shadows.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
CS 325 Introduction to Computer Graphics 03 / 24 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 23 / 2007 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 03 / 22 / 2010 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 04 / 14 / 2010 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Ray-tracing.
CS 376b Introduction to Computer Vision 03 / 18 / 2008 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 04 / 02 / 2007 Instructor: Michael Eckmann.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
CSCE 441: Computer Graphics Ray Tracing
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
College of Computer and Information Science, Northeastern UniversityFebruary 3, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2006.
More on Ray Tracing Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, April 14, 2004.
CS 325 Introduction to Computer Graphics 03 / 10 / 2010 Instructor: Michael Eckmann.
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.
CS 325 Introduction to Computer Graphics 04 / 07 / 2010 Instructor: Michael Eckmann.
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
CS552: Computer Graphics Lecture 33: Illumination and Shading.
CS 376 Introduction to Computer Graphics 04 / 13 / 2007 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 04 / 18 / 2007 Instructor: Michael Eckmann.
Photorealistic Rendering vs. Interactive 3D Graphics
CS G140 Graduate Computer Graphics
Ray Tracing Dr. Scott Schaefer.
RAY TRACING.
Ray Tracing.
Lighting.
Illumination and Shading
CSCE 441: Computer Graphics Ray Tracing
GR2 Advanced Computer Graphics AGR
Frame Buffer Applications
Simple Texture Mapping
Introduction to Ray Tracing
Presentation transcript:

CS 325 Introduction to Computer Graphics 04 / 09 / 2010 Instructor: Michael Eckmann

Michael Eckmann - Skidmore College - CS Spring 2010 Today’s Topics Questions? Go over the pseudocode for ray tracing Adding surface detail –Texture mapping

RayTracing Let's take a look at the handout which shows pseudocode for a recursive ray tracing algorithm and see what it entails. We'll have all our objects defined in the world (assume only spheres and polygons) with world coordinates. First part shows that we decide on a CoP and a view plane then go through the image to be created one pixel at a time from left to right on a scan line and top to bottom in scan lines. For each pixel we –Determine the ray through the center of the pixel starting at the CoP (how to we determine this?)‏ –Then call RT_trace and pass in that ray and the number 1 (for the current depth in the ray tree)‏ –RT_trace will return the color that the pixel should be RT_trace first determines which is the closest object of intersection (how would we do this?)‏ –If the ray doesn't intersect any object, then return the background color (whatever you decide it to be) otherwise...

RayTracing RT_trace first determines which is the closest object of intersection (how would we do this?)‏ –If the ray doesn't intersect any object, then return the background color (whatever you decide it to be) otherwise –call RT_shade with the closest object intersected, the ray, the point of intersection, the normal at that intersection (calculate this) and the depth (which is 1 the first time). How do we compute the point of intersection with the object? How do we compute the normal there? In RT_shade we set the color initially to be some ambient term (based on an ambient coefficient for the object, the object's color and our ambient light defined in our world.)‏ Go through all the lights in our world and determine the shadow rays one at a time. It then says “if the dot product of normal and direction to light is positive”. Can anyone describe what that tells us? –If a shadow ray is blocked by an opaque surface then ignore it. –If a shadow ray goes through a transparent surface reduce the amount of light transmitted by some factor (k t ) which is associated with the object (see Basic Transparency Model discussion on pages in text). –If a shadow ray doesn't intersect anything, then just attenuate the light based on the distance. Use this attenuated light and the surface's diffuse property to compute the diffuse term.

RayTracing Then add each of the shadow ray/diffuse contributions to the color RT_shade then continues as long as depth < MaxDepth. Depth is initially 1 and MaxDepth can be set to something like 4. –Recursively call RT_trace for the reflection ray (and depth+1) if the surface is specularly reflective Scale the color returned by the specular coefficient of the surface Add this to the color of the pixel we're calculating –Recursively call RT_trace for the refraction ray (and depth+1) if the surface is transparent Scale the color returned by the transmission coefficient of the surface Add this to the color of the pixel we're calculating Return color

RayTracing Comments about ray tracing –To store which object is closest for a given ray through a pixel, we could use an altered form of the z-buffer method. –How did z-buffer method (aka depth buffer) work again?

RayTracing A few comments about ray tracing –To store which object is closest for a given ray through a pixel, we could use an altered form of the z-buffer method. –How did z-buffer method (aka depth buffer) work again? It stored the color of the nearest surface for each pixel into the frame buffer and the distance into a z-buffer Instead of storing the distance into the z-buffer, store which object is closest into an item-buffer.

RayTracing A few comments about ray tracing –Instead of creating the same depth tree for each ray (that is, the number of levels of recursion) at a particular level, determine if the expected maximum contribution (to the color of the pixel) of the ray to be cast will not be above some threshold. If it is deemed to be insignificant, don't cast it. If it has the potential to be significant, cast it. For example, a primary ray hits an object which could cast a reflection ray and that reflection ray also hits an object and casts a reflection ray and that one also hits an object and can cast a reflection ray. The surface that the second reflection ray hits might have a very small specular coefficient thereby influencing the color of the pixel insignificantly, so, then don't cast that ray (and you can save the computation for that ray as well as the ray it would have spawned, and so on.)‏ Ideally in this situation, only the ones that count will be recursed to further depths.