Ray Tracing. Outline. Ray Tracing: History

Similar documents
Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Ray Casting. Outline. Similar to glulookat derivation. Foundations of Computer Graphics

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Ray Casting. Outline in Code. Outline. Finding Ray Direction. Heckbert s Business Card Ray Tracer. Foundations of Computer Graphics (Fall 2012)

Ray Casting. To Do. Outline. Outline in Code. Foundations of Computer Graphics (Spring 2012) Heckbert s Business Card Ray Tracer

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Sung-Eui Yoon ( 윤성의 )

Lecture 11: Ray tracing (cont.)

CS559: Computer Graphics

CPSC GLOBAL ILLUMINATION

Graphics 2009/2010, period 1. Lecture 8: ray tracing

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

Ray Casting. 3D Rendering. Ray Casting. Ray Casting. Ray Casting. Ray Casting

Intro to Ray-Tracing & Ray-Surface Acceleration

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

COMP371 COMPUTER GRAPHICS

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

Ray Tracing. Foley & Van Dam, Chapters 15 and 16

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

Computer Graphics and Image Processing Ray Tracing I

Ray Casting. Outline. Outline in Code

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

SUMMARY. CS380: Introduction to Computer Graphics Ray tracing Chapter 20. Min H. Kim KAIST School of Computing 18/05/29. Modeling

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Assignment 6: Ray Tracing

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Computer Graphics Ray Casting. Matthias Teschner

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Spatial Data Structures

Lecture 11. More Ray Casting/Tracing

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting

Shading, Advanced Rendering. Week 7, Wed Feb 28

Review for Ray-tracing Algorithm and Hardware

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

Computer Graphics. Bing-Yu Chen National Taiwan University

Questions??? Announcements Assignment 3 due today

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Supplement to Lecture 16

Geometric Queries for Ray Tracing

Lecture 8 Ray tracing Part 1: Basic concept Yong-Jin Liu.

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Fall 2012)

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

Spatial Data Structures

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Ray Tracing. Last Time? Reading for Today. Reading for Today

1999, Denis Zorin. Ray tracing

Last week. Machiraju/Zhang/Möller

Illumination Algorithms

Acceleration Data Structures

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Advanced Ray Tracing

Accelerated Raytracing

Ray tracing. EECS 487 March 19,

CS-184: Computer Graphics. Administrative

Viewing and Ray Tracing. CS 4620 Lecture 4

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Lecture 10: Ray tracing

Viewing and Ray Tracing

The Traditional Graphics Pipeline

Accelerating Ray-Tracing

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

Ray Casting. Connelly Barnes CS 4810: Graphics

Ray casting. Ray casting/ray tracing

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Computer Graphics. Ray Tracing. Based on slides by Dianna Xu, Bryn Mawr College

03 RENDERING PART TWO

Spatial Data Structures

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule

Ray Tracing I. Internet Raytracing Competition

Photorealism: Ray Tracing

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

Computer Graphics I Lecture 11

COMPLETION OF Z-buffer Graphics Pipeline

lecture 18 - ray tracing - environment mapping - refraction

Ray Tracing Part 1. CSC418/2504 Introduction to Computer Graphics. TA: Muhammed Anwar & Kevin Gibson

Graphics Pipeline. CS535 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Lecture 17: Recursive Ray Tracing. Where is the way where light dwelleth? Job 38:19

Computer Graphics. - Ray Tracing I - Marcus Magnor Philipp Slusallek. Computer Graphics WS05/06 Ray Tracing I

Accelerating Ray Tracing

The Traditional Graphics Pipeline

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

CS Simple Raytracer for students new to Rendering

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

The Traditional Graphics Pipeline

Computer Graphics Global Illumination

Transcription:

Foundations of omputer Graphics Online Lecture 9: Ray Tracing 1 History and asic Ray asting Ravi Ramamoorthi Effects needed for Realism (Soft) Shadows Reflections (Mirrors and Glossy) Transparency (Water, Glass) Interreflections (olor leeding) omplex Illumination (Natural, rea Light) Realistic Materials (Velvet, Paints, Glass) Ray Tracing Different pproach to Image Synthesis as compared to Hardware pipeline (OpenGL) Pixel by Pixel instead of Object by Object Easy to compute shadows/transparency/etc History asic Ray asting (instead of rasterization) omparison to hardware scan conversion ppel 68 Ray Tracing: History Whitted 80 [recursive ray tracing] Landmark in computer graphics Lots of work on various geometric primitives Lots of work on accelerations urrent Research Real-Time raytracing (historically, slow technique) Ray tracing architecture Ray Tracing History n improved illumination model for shaded display by T. Whitted, M 1980 512x512, VX 11/780 74 min, today real-time Turner Whitted 1980. Spheres and heckerboard 1

in ode Image Raytrace (amera cam, Scene scene, int width, int height) { Image image = new Image (width, height) ; for (int i = 0 ; i < height ; i++) for (int j = 0 ; j < width ; j++) { Ray ray = RayThruPixel (cam, i, j) ; Intersection hit = Intersect (ray, scene) ; image[i][j] = Findolor (hit) ; } return image ; } History asic Ray asting (instead of rasterization) omparison to hardware scan conversion Ray asting Ray asting Produce same images as with OpenGL Visibility per pixel instead of Z-buffer Find nearest object by shooting rays into scene Shade it as in standard OpenGL Virtual Viewpoint Virtual Screen Objects Ray Multiple misses intersects intersections: all object: objects: shade Pixel Use using colored closest color, black one lights, (as does materials OpenGL) omparison to hardware scan-line Per-pixel evaluation, per-pixel rays (not scan-convert each object). On face of it, costly ut good for walkthroughs of extremely large models (amortize preprocessing, low complexity) More complex shading, lighting effects possible Foundations of omputer Graphics Online Lecture 9: Ray Tracing 1 ore lgorithm: Shadows and Reflections Ravi Ramamoorthi 2

History asic Ray asting (instead of rasterization) omparison to hardware scan conversion Virtual Viewpoint Shadows Virtual Screen Objects Shadow ray to to light is is unblocked: object visible in shadow Light Source Shadows: Numerical Issues Numerical inaccuracy may cause intersection to be below surface (effect exaggerated in figure) ausing surface to incorrectly shadow itself Move a little towards light before shooting shadow ray Mirror Reflections/Refractions Virtual Viewpoint Virtual Screen Generate reflected ray in mirror direction, Get reflections and refractions of objects Objects Recursive Ray Tracing For each pixel Trace Primary Eye Ray, find intersection Trace Secondary Shadow Ray(s) to all light(s) olor = Visible? Illumination Model : 0 ; Trace Reflected Ray olor += reflectivity * olor of reflected ray Problems with Recursion Reflection rays may be traced forever Generally, set maximum recursion depth Same for transmitted rays (take refraction into account) 3

Effects needed for Realism (Soft) Shadows Reflections (Mirrors and Glossy) Transparency (Water, Glass) Interreflections (olor leeding) omplex Illumination (Natural, rea Light) Discussed in this lecture Not discussed but possible with distribution ray tracing Hard (but not impossible) with ray tracing; radiosity methods Foundations of omputer Graphics Online Lecture 9: Ray Tracing 1 Ray-Surface Intersection Ravi Ramamoorthi History asic Ray asting (instead of rasterization) omparison to hardware scan conversion Ray/Object Intersections Heart of Ray Tracer One of the main initial research areas Optimized routines for wide variety of primitives Various types of info Shadow rays: Intersection/No Intersection Primary rays: Point of intersection, material, normals Texture coordinates Work out examples Triangle, sphere, polygon, general implicit surface Substitute P 0 4

Substitute Substitute Simplify Simplify Solve quadratic equations for t 2 real positive roots: pick smaller root oth roots same: tangent to sphere One positive, one negative root: ray origin inside sphere (pick + root) omplex roots: no intersection (check discriminant of equation first) Intersection point: Normal (for sphere, this is same as coordinates in sphere frame of reference, useful other tasks) Ray-Triangle Intersection One approach: Ray-Plane intersection, then check if inside triangle Plane equation: Ray-Triangle Intersection One approach: Ray-Plane intersection, then check if inside triangle Plane equation: 5

Ray-Triangle Intersection One approach: Ray-Plane intersection, then check if inside triangle Plane equation: Ray-Triangle Intersection One approach: Ray-Plane intersection, then check if inside triangle Plane equation: ombine with ray equation Ray inside Triangle Once intersect with plane, need to find if in triangle Many possibilities for triangles, general polygons We find parametrically [barycentric coordinates]. lso useful for other applications (texture mapping) α β P γ Ray inside Triangle β α P γ Other primitives Much early work in ray tracing focused on ray-primitive intersection tests ones, cylinders, ellipsoids oxes (especially useful for bounding boxes) General planar polygons Many more Ray-Tracing Transformed Objects We have an optimized ray-sphere test ut we want to ray trace an ellipsoid Solution: Ellipsoid transforms sphere pply inverse transform to ray, use ray-sphere llows for instancing (traffic jam of cars) Mathematical details worked out next 6

Transformed Objects Transformed Objects onsider a general 4x4 transform M (matrix stacks) pply inverse transform M -1 to ray Locations stored and transform in homogeneous coordinates Vectors (ray directions) have homogeneous coordinate set to 0 [so there is no action because of translations] Do standard ray-surface intersection as modified Transform intersection back to actual coordinates Intersection point p transforms as Mp Normals n transform as M -t n. Do all this before lighting Foundations of omputer Graphics Online Lecture 9: Ray Tracing 1 Optimizations Ravi Ramamoorthi History asic Ray asting (instead of rasterization) omparison to hardware scan conversion urrent Research cceleration Testing each object for each ray is slow Fewer Rays daptive sampling, depth control Generalized Rays eam tracing, cone tracing, pencil tracing etc. Faster Intersections (more on this later) Optimized Ray-Object Intersections Fewer Intersections cceleration Structures ounding boxes (possibly hierarchical) If no intersection bounding box, needn t check objects Ray ounding ox Spatial Hierarchies (Oct-trees, kd trees, SP trees) 7

cceleration Structures: Grids cceleration and Regular Grids Simplest acceleration, for example 5x5x5 grid For each grid cell, store overlapping triangles March ray along grid (need to be careful with this), test against each triangle in grid cell More sophisticated: kd-tree, oct-tree bsp-tree Or use (hierarchical) bounding boxes 8