Lecture 8 Advanced Rendering – Ray Tracing, Radiosity & NPR.

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

GR2 Advanced Computer Graphics AGR
Collisions and Intersections When objects move, test for collision. When projecting surfaces, check for intersections. (Many slides adapted from Amitabh.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Lecture 14 Illumination II – Global Models
03/12/02 (c) 2002 University of Wisconsin, CS559 Last Time Some Visibility (Hidden Surface Removal) algorithms –Painter’s Draw in some order Things drawn.
David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Shadow Rendering Techniques A point is in the shadow of a light source if it can not be “seen” by the light source, i.e. the line segment that connects.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Ray Tracing Variants Distributed ray tracing Generalized rays Cone Tracing Beam Tracing Pencil.
Illumination Model & Surface-rendering Method 박 경 와.
Christian Lauterbach COMP 770, 2/11/2009
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
RAY TRACING.
A lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating.
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.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Spatial Data Structure: Quadtree, Octree,and BSP tree Mengxia Zhu Fall 2007.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes.
Presentation of LR2V Kadi Bouatouch IRISA
CSC418 Computer Graphics n Raytracing n Shadows n Global Illumination.
Hidden Surface Removal
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
What is Computer Graphics and Image Processing? lAll visual computer output depends on computer graphics and image processing. l3D computer graphics is.
10/29/02 (c) 2002 University of Wisconsin, CS559 Today Hidden Surface Removal Exact Visibility.
COMP 175: Computer Graphics March 24, 2015
Today More raytracing stuff –Soft shadows and anti-aliasing More rendering methods –The text book is good on this –I’ll be using images from the CDROM.
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.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
Ray Tracing Jian Huang, CS 594, Fall, 2002 This set of slides are used at Ohio State by Prof. Roger Crawfis.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
03/14/02 (c) 2002 University of Wisconsin, CS559 Last Time Some more visibility (Hidden Surface Removal) algorithms –A-buffer –Scanline –Depth sorting.
Recursion and Data Structures in Computer Graphics Ray Tracing 1.
Binary Space Partitioning Trees Ray Casting Depth Buffering
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
CSE 681 DISTRIBUTED RAY TRACING some implementation notes.
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.
Where We Stand At this point we know how to: –Convert points from local to window coordinates –Clip polygons and lines to the view volume –Determine which.
Bounding Volume Hierarchy. The space within the scene is divided into a grid. When a ray travels through a scene, it only passes a few boxes within the.
CSCE 441: Computer Graphics Ray Tracing
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Radiosity Radiosity.
CS559: Computer Graphics Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008.
MIT EECS 6.837, Durand and Cutler Acceleration Data Structures for Ray Tracing.
David Luebke 3/5/2016 Advanced Computer Graphics Lecture 4: Faster Ray Tracing David Luebke
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.
David Luebke3/12/2016 Advanced Computer Graphics Lecture 3: More Ray Tracing David Luebke
Distributed Ray Tracing. Can you get this with ray tracing?
CS 325 Introduction to Computer Graphics 04 / 07 / 2010 Instructor: Michael Eckmann.
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Distributed Ray Tracing. Can you get this with ray tracing?
CS552: Computer Graphics Lecture 33: Illumination and Shading.
Basic Ray Tracing CMSC 435/634.
© University of Wisconsin, CS559 Fall 2004
Distributed Ray Tracing
CSCE 441: Computer Graphics Ray Tracing
GR2 Advanced Computer Graphics AGR
Simple Texture Mapping
CSC418 Computer Graphics Raytracing Shadows Global Illumination.
Presentation transcript:

Lecture 8 Advanced Rendering – Ray Tracing, Radiosity & NPR

Ray Tracing Y X Z eye screen incident ray world coordinates scene model nearest intersected surface refracted ray reflected ray shadow “feeler” ray Slide Courtesy of Roger Crawfis, Ohio State

Ray-Tracing Pseudocode For each ray r from eye to pixel, color the pixel the value returned by ray_cast(r): ray_cast(r) { s  nearest_intersected_surface(r); p  point_of_intersection(r, s); u  reflect(r, s, p); v  refract(r, s, p); c  phong(p, s, r) + s.k reflect  ray_cast(u) + s.k refract  ray_cast(v); return(c); } Slide Courtesy of Roger Crawfis, Ohio State

Pseudocode Explained s  nearest_intersected_surface(r); –Use geometric searching to find the nearest surface s intersected by the ray r p  point_of_intersection(r, s); –Compute p, the point of intersection of ray r with surface s u  reflect(r, s, p); v  refract(r, s, p); –Compute the reflected ray u and the refracted ray v using Snell’s Laws Slide Courtesy of Roger Crawfis, Ohio State

Reflected and Refracted Rays Reflected and refracted rays are computed using Snell’s Law surface reflected ray incident ray surface normal refracted ray Slide Courtesy of Roger Crawfis, Ohio State

Pseudocode Explained phong(p, s, r) –Evaluate the Phong reflection model for the ray r at point p on surface s, taking shadowing into account (see next slide) s.k reflect  ray_cast(u) –Multiply the contribution from the reflected ray u by the specular-reflection coefficient k reflect for surface s s.k refract  ray_cast(v) –Multiply the contribution from the refracted ray v by the specular-refraction coefficient k refract for surface s Slide Courtesy of Roger Crawfis, Ohio State

About Those Calls to ray_cast()... The function ray_cast() calls itself recursively There is a potential for infinite recursion –Consider a “hall of mirrors” Solution: limit the depth of recursion –A typical limit is five calls deep –Note that the deeper the recursion, the less the ray’s contribution to the image, so limiting the depth of recursion does not affect the final image much Slide Courtesy of Roger Crawfis, Ohio State

Pros and Cons of Ray Tracing Advantages of ray tracing –All the advantages of the Phong model –Also handles shadows, reflection, and refraction Disadvantages of ray tracing –Computational expense –No diffuse inter-reflection between surfaces –Not physically accurate Other techniques exist to handle these shortcomings, at even greater expense! Slide Courtesy of Roger Crawfis, Ohio State

An Aside on Antialiasing Our simple ray tracer produces images with noticeable “jaggies” Jaggies and other unwanted artifacts can be eliminated by antialiasing: –Cast multiple rays through each image pixel –Color the pixel the average ray contribution –An easy solution, but it increases the number of rays, and hence computation time, by an order of magnitude or more Slide Courtesy of Roger Crawfis, Ohio State

Reflections Mathematically, what does this mean? What is the reflected color? Slide Courtesy of Roger Crawfis, Ohio State

Glossy Reflections We need to integrate the color over the reflected cone. Weighted by the reflection coefficient in that direction. Slide Courtesy of Roger Crawfis, Ohio State

Translucency Likewise, for blurred refractions, we need to integrate around the refracted angle. Slide Courtesy of Roger Crawfis, Ohio State

Translucency Slide Courtesy of Roger Crawfis, Ohio State

Translucency Slide Courtesy of Roger Crawfis, Ohio State

Shadows Ray tracing casts shadow feelers to a point light source. Many light sources are illuminated over a finite area. The shadows between these are substantially different. Area light sources cast soft shadows –Penumbra –Umbra

Soft Shadows Slide Courtesy of Roger Crawfis, Ohio State

Soft Shadows Umbra Penumbra Slide Courtesy of Roger Crawfis, Ohio State

Camera Models Up to now, we have used a pinhole camera model. These has everything in focus throughout the scene. The eye and most cameras have a larger lens or aperature. Slide Courtesy of Roger Crawfis, Ohio State

Depth-of-Field

Motion Blur Slide Courtesy of Roger Crawfis, Ohio State

Supersampling 1 sample per pixel256 sample per pixel16 sample per pixel Slide Courtesy of Roger Crawfis, Ohio State

More On Ray-Tracing Already discussed recursive ray- tracing! Improvements to ray-tracing! –Area sampling variations to address aliasing Cone tracing (only talk about this) Beam tracing Pencil tracing Distributed ray-tracing!

Area Subdivision (Warnock) (mixed object/image space) Clipping used to subdivide polygons that are across regions

Area Subdivision (Warnock) 1.Initialize the area to be the image plane 2.Four cases: 1.No polygons in area: done 2.One polygon in area: draw it 3.Pixel sized area: draw closest polygon 4.Front polygon covers area: draw it Otherwise, subdivide and recurse

BSP (Binary Space Partition) Trees Partition space into 2 half-spaces via a hyper-plane a b c d e a cb ed

BSPNode* BSPCreate(polygonList pList) if(pList is empty) return NULL; pick a polygon p from pList; split all polygons in pList by p and insert pieces into pList; polygonList coplanar = all polygons in pList coplanar to p; polygonList positive = all polygons in pList in p’s positive halfspace; polygonList negative = all polygons in pList in p’s negative halfspace; BSPNode *b = new BSPNode; b->coplanar = coplanar; b->positive = BSPCreate(positive); b->negative = BSPCreate(negative); return b; BSP Trees Creating the BSP Tree

BSPRender(vertex eyePoint, BSPNode *b) if(b == NULL) return; if(eyePoint is in positive half-space defined by b->coplanar) BSPRender(eyePoint,b->negative); draw all polygons in b->coplanar; BSPRender(eyePoint,b->positive); else BSPRender(eyePoint,b->positive); draw all polygons in b->coplanar; BSPRender(eyePoint,b->negative); BSP Trees Rendering the BSP Tree

BSP Trees Advantages  view-independent tree  anti-aliasing (see later)  transparency Disadvantages  many small polygons  over-rendering  hard to balance tree

Portals Separate environment into cells Preprocess to find potentially visible polygons from any cell

Portals Treat environment as a graph Nodes = cells, Edges = portals Cell to cell visibility must go along edges

More spatial subdivision methods… Octree Bounding volume (box, sphere) Oriented Bounding Box