© University of Wisconsin, CS559 Fall 2004

Slides:



Advertisements
Similar presentations
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Advertisements

Advanced Effects CMSC 435/634. General Approach Ray Tracing – Shoot more rays Rasterization – Render more images.
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.
Advanced Ray Tracing CMSC 435/634. Basic Ray Tracing For each pixel – Compute ray direction – Find closest surface – For each light Compute direct illumination.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
Christian Lauterbach COMP 770, 2/11/2009
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
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.
Lecture 8 Advanced Rendering – Ray Tracing, Radiosity & NPR.
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 & visualization Ray-Tracing – A Quick review.
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.
12/05/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling Very brief intro to global illumination.
-Global Illumination Techniques
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.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
Ray Tracing Jian Huang, CS 594, Fall, 2002 This set of slides are used at Ohio State by Prof. Roger Crawfis.
02/10/03© 2003 University of Wisconsin Last Time Participating Media Assignment 2 –A solution program now exists, so you can preview what your solution.
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.
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.
CSE 681 DISTRIBUTED RAY TRACING some implementation notes.
Basic Ray Tracing CMSC 435/634.
Ray-tracing.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
In the name of God Computer Graphics. Last Time Some techniques for modeling Today Global illumination and raytracing.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
RENDERING : Global Illumination
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.
11/29/01CS 559, Fall 2001 Today Photorealistic rendering Algorithms for producing high-quality images Ways of deciding which algorithm for use.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Introduction to Ray Tracing Dr. B. Raghu Professor /CSE Sri Ramanujar Engineering College.
Basic Ray Tracing CMSC 435/634.
3D Rendering 2016, Fall.
Advanced Computer Graphics
Hank Childs, University of Oregon
Rendering Pipeline Fall, 2015.
- Introduction - Graphics Pipeline
CSE 167 [Win 17], Lecture 15: Ray Tracing Ravi Ramamoorthi
Photorealistic Rendering vs. Interactive 3D Graphics
Shading Revisited Some applications are intended to produce pictures that look photorealistic, or close to it The image should look like a photograph A.
Distributed Ray Tracing
Ray Tracing Dr. Scott Schaefer.
3D Graphics Rendering PPT By Ricardo Veguilla.
RAY TRACING.
Interactive Computer Graphics
(c) 2002 University of Wisconsin
Path Tracing (some material from University of Wisconsin)
Lighting.
Distributed Ray Tracing
Distributed Ray Tracing
(c) 2002 University of Wisconsin
Image synthesis using classical optics
Image.
Monte Carlo Rendering Central theme is sampling:
CS5500 Computer Graphics May 29, 2006
CSCE 441: Computer Graphics Ray Tracing
Distributed Ray Tracing
GR2 Advanced Computer Graphics AGR
Introduction to Ray Tracing
Distributed Ray Tracing
CSC418 Computer Graphics Raytracing Shadows Global Illumination.
Presentation transcript:

© University of Wisconsin, CS559 Fall 2004 Last Time Animation Key-frame (hand animation) Motion capture Procedural Evaluations 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Today Raytracing 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 OpenGL Limitations Stream processing of geometry No random access to geometric information Can’t do any computation that requires all the geometry at once Rasterization is limited We saw many ways to represent objects – not all can be rasterized Cannot provide rasterizers for every form of geometry Everything get rasterized and drawn Figuring out what you can see before rasterizing is possible but hard Computation loops over geometry, then pixels for all objects { for all pixels in object … } 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Raytracing Cast rays out from the eye, through each pixel, and determine what the rays hit Builds the image pixel by pixel, one at a time Cast additional rays from the hit point to determine the pixel color Rays test visibility – what do I see from this point in this direction? Ray casting is widely used in graphics to test visibility 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Raytracing Shadow rays Reflection ray Transmitted ray 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Recursive Ray Tracing When a reflected or refracted ray hits a surface, repeat the whole process from that point Send out more shadow rays Send out new reflected ray (if required) Send out a new refracted ray (if required) Generally, reduce the weight of each additional ray when computing the contributions to surface color Stop when the contribution from a ray is too small to notice The result is a ray tree 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Ray Tree B Eye A L1 A L1 L2 B C L2 L2 C L2 L1 L1 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 PCKTWTCH by Kevin Odhner, POV-Ray 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Kettle, Mike Miller, POV-Ray 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 12/14/04 © University of Wisconsin, CS559 Fall 2004

Raytracing Implementation Raytracing breaks down into two tasks: Constructing the rays to cast Intersecting rays with geometry The former problem is simple vector arithmetic The intersection problem arises in many areas of computer graphics Collision detection Other rendering algorithms Intersection is essentially root finding (as we will see) Any root finding technique can be applied 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Constructing Rays Define rays by an initial point and a direction Eye rays: Rays from the eye through a pixel Shadow rays: Rays from a point on a surface to a light If the ray hits something before it gets to the light, then the point is in shadow Reflection rays: Rays from a point on a surface in the reflection direction Only for reflective surfaces Transmitted rays: Rays from a point on a transparent surface through the surface Use Snell’s law to get refraction direction 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Eye Rays Image Eye FOV/2 Find this point to get ray. Transform from view to world space. (0,0,0) 12/14/04 © University of Wisconsin, CS559 Fall 2004

Ray-Object Intersections Aim: Find the parameter value, ti, at which the ray first meets object i Transform the ray into the object’s local coordinate system Makes ray-object intersections generic: ray-sphere, ray-plane, … Write the surface of the object implicitly: f(x)=0 Unit sphere at the origin is x•x-1=0 Plane with normal n passing through origin is: n•x=0 Put the ray equation in for x Result is an equation of the form f(t)=0 where we want t Now it’s just root finding 12/14/04 © University of Wisconsin, CS559 Fall 2004

Ray-Sphere Intersection Quadratic in t 2 solutions: Ray passes through sphere - take minimum value that is > 0 1 solution: Ray is tangent - use it if >0 0 solutions: Ray does not hit sphere 12/14/04 © University of Wisconsin, CS559 Fall 2004

Ray-Plane Intersections To do polygons, intersect with plane then do point-in-polygon test… Faster tests for triangles, but this is the start point 12/14/04 © University of Wisconsin, CS559 Fall 2004

Ray-Patch Intersection Equation in 3 parameters: t, u, v Solve using Newton’s method for root finding Have derivatives from basis functions Starting point from control polygon, or random guess, or try a whole set of different starting values Intersect with a bounding box first to avoid wasteful, complex test 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Details Must find first intersection of ray from the eye Find all candidate intersections, sort them and take soonest Techniques for avoiding testing all objects Bounding boxes that are cheap to test Octrees for organizing objects in space Take care to eliminate intersections behind the eye Same rules apply for reflection and transmission rays Shadow ray just has to find any intersection shadowing the light source Speedup: Keep a cache of shadowing objects - test those first 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Mapping Techniques All raytracing calculations are done for every pixel Raytracing provides a wealth of information about the visible surface point: Position, normal, texture coordinates, illuminants, color… Raytracing also has great flexibility Every point is computed independently, so effects can easily be applied on a per-pixel basis Reflection and transmission and shadow rays can be manipulated for various effects Even the intersection point can be modified 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Bump Mapping Examples 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Soft Shadows Light sources that extend over an area (area light sources) should cast soft-edged shadows Some points see all the light - fully illuminated Some points see none of the light source - the umbra Some points see part of the light source - the penumbra To ray-trace area light sources, cast multiple shadow rays Each one to a different point on the light source Weigh illumination by the number that get through 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Soft Shadows Penumbra Umbra Penumbra 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Soft Shadows All shadow rays go through No shadow rays go through Some shadow rays go through 12/14/04 © University of Wisconsin, CS559 Fall 2004

Ray-Tracing and Sampling Basic ray-tracing casts one ray through each pixel, sends one ray for each reflection, one ray for each point light, etc This represents a single sample for each point, and for an animation, a single sample for each frame Many important effects require more samples: Motion blur: A photograph of a moving object smears the object across the film (longer exposure, more motion blur) Depth of Field: Objects not located at the focal distance appear blurred when viewed through a real lens system Rough reflections: Reflections in a rough surface appear blurred 12/14/04 © University of Wisconsin, CS559 Fall 2004

Distribution Raytracing Distribution raytracing casts more than one ray for each sample Originally called distributed raytracing, but the name’s confusing How would you sample to get motion blur? How would you sample to get rough reflections? How would you sample to get depth of field? 12/14/04 © University of Wisconsin, CS559 Fall 2004

Distribution Raytracing Multiple rays for each pixel, distributed in time, gives you motion blur Object positions have to vary continuously over time Casting multiple reflection rays at a reflective surface and averaging the results gives you rough, blurry reflections Simulating multiple paths through the camera lens system gives you depth of field 12/14/04 © University of Wisconsin, CS559 Fall 2004

© University of Wisconsin, CS559 Fall 2004 Motion Blur 12/14/04 © University of Wisconsin, CS559 Fall 2004

Distribution Raytracing Depth of Field From Alan Watt, “3D Computer Graphics” 12/14/04 © University of Wisconsin, CS559 Fall 2004