Computer Graphics. Ray Tracing. Copyright Gotsman, Elber, Barequet, Karni, Sheffer. Page 1. Ray-Tracing. Illumination Models

Similar documents
CS5620 Intro to Computer Graphics

CPSC GLOBAL ILLUMINATION

Ray Tracing. Local Illumination. Object Space: Global Illumination. Image Space: Backward Ray Tracing. First idea: Forward Ray Tracing

Shading, Advanced Rendering. Week 7, Wed Feb 28

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

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

Illumination Models and Shading

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

Modeling Transformations

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

Parallelization. Memory coherency helps when distributing rays to various threads/processors

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

Supplement to Lecture 16

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Ray Tracing. Quiz Discussion. Announcements: Final Projects. Last Time? Durer s Ray Casting Machine. Today

Ray Tracing. Last Time? Today. Ray Casting. Durer s Ray Casting Machine. Reading for Today

Modeling Transformations

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007

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

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

Ray Tracing. Announcements: Quiz. Last Time? Today. Durer s Ray Casting Machine. Ray Casting

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

Ray Tracing. Kjetil Babington

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

Ray-Tracing. Misha Kazhdan

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

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

Lighting and Shading

Recursion and Data Structures in Computer Graphics. Ray Tracing

Lecture 10: Ray tracing

Lecture 18: Primer on Ray Tracing Techniques

Ray tracing. EECS 487 March 19,

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

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

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

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

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

CHAPTER 1 Graphics Systems and Models 3

Implementation Issues

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

CS5620 Intro to Computer Graphics

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: 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 Ray Casting. Matthias Teschner

Sung-Eui Yoon ( 윤성의 )

CS 465 Program 5: Ray II

COMP371 COMPUTER GRAPHICS

Specular reflection. Lighting II. Snell s Law. Refraction at boundary of media

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Review for Ray-tracing Algorithm and Hardware

COMPLETION OF Z-buffer Graphics Pipeline

Introduction to Visualization and Computer Graphics

COMP 175 COMPUTER GRAPHICS. Lecture 11: Recursive Ray Tracer. COMP 175: Computer Graphics April 9, Erik Anderson 11 Recursive Ray Tracer

CS 4204 Computer Graphics

03 RENDERING PART TWO

Ray Tracing. CS116B Chris Pollett Apr 20, 2004.

Illumination Models & Shading

COMPUTER GRAPHICS AND INTERACTION

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

The University of Calgary

Path Tracing. Mikael Persson mpersson December 3, 2001

CS 325 Computer Graphics

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

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

Lecture 11. More Ray Casting/Tracing

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Ray Tracing. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen

Photorealism: Ray Tracing

Single Scattering in Refractive Media with Triangle Mesh Boundaries

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Surface Rendering Methods

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

Recursive Ray Tracing. Ron Goldman Department of Computer Science Rice University

Local vs. Global Illumination & Radiosity

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Lecture 12: Advanced Rendering

Reflection and Shading

Photorealistic 3D Rendering for VW in Mobile Devices

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

Indirect Illumination

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

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Introduction to Ray-tracing Objectives

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Ray Tracing: Intersection

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

What does OpenGL do?

RAYTRACING. Christopher Peters INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION. HPCViz, KTH Royal Institute of Technology, Sweden

Introduction to Computer Graphics 7. Shading

Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

Advanced Ray Tracing

Comp 410/510 Computer Graphics. Spring Shading

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

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

CS 4620 Program 4: Ray II

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

Raytracing. COSC 4328/5327 Scott A. King

9. Illumination and Shading

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

Transcription:

Ra Tracing Ra-Tracing Illumination Models Local: Depends onl on the model, the light sources and the viewer. Eas to simulate. Eamples: Diffuse and specular illumination models. Flat, Gourard and Phong shading of polhedra. Global: Depends on the entire scene, the light sources and the viewer. Comple to simulate. Eamples: Shadow algorithms, ra-tracing, radiosit methods. Bring the objects to the screen Bring the screen to the objects 3 5 6 Copright Gotsman, Elber, Barequet, Karni, Sheffer Page 1

Ra Tracing 8 9 10 11 1 Copright Gotsman, Elber, Barequet, Karni, Sheffer Page

Ra Tracing 13 14 15 16 17 18 Copright Gotsman, Elber, Barequet, Karni, Sheffer Page 3

Ra Tracing Rendering Equation Ra-Casting Algorithm Ee Image Plane I (, ) g(, )[ e(, ) s(,, ) I(, ) d] Surf Primar Ra 19 0 A Basic Ra-Casting Algorithm RaCast (r, scene) <obj, p> := FirstIntersection(r, scene) if (no obj) return BackgroundColor; else return Shade(p, obj); end; 1 Ra-Object Intersection In the kernel of ever ra-tracer Ra-object intersections are computed millions of times for a single image, hence must be ver efficient Eample: Ra-Sphere intersection ra: ( t) p v t, ( t) p v t, ( t) p v t (unit) sphere: 1 Solve a quadratic equation in t : 0 ( p v t) ( p v t) ( p v t) 1 t ( v v v ) t( p v p v p v ) ( p p p ) 1 p v Ra-Tracing Algorithm Reflection and Refraction Ee Image Plane n Primar Ra Reflected Ra Reflected Ra Snell s law sin 1 c1 sin c n 1 Refracted Ra 3 4 Copright Gotsman, Elber, Barequet, Karni, Sheffer Page 4

Ra Tracing A Basic Ra-Tracing Algorithm RaTrace(r, scene) <obj, p> := FirstIntersection(r, scene) if (no obj) return BackgroundColor; else begin if ( Reflect(obj) ) then ReflectColor := RaTrace(ReflectRa(r, p, obj)); else ReflectColor := Black; if ( Transparent(obj) ) then RefractColor := RaTrace(RefractRa(r, p, obj)); else RefractColor := Black; return Shade(ReflectColor, RefractColor, p, obj); end; Termination in Ra-Tracing Possible termination criteria: No intersection Contribution of secondar ra attenuated below a threshold Maimal depth 5 6 Supersampling Trace multiple primar ras per piel and average their results. 7 8 Optimied Ra-Tracing Basic algorithm is simple but VERY epensive. Optimied ra-tracing is critical Reduce number of ras traced Reduce number of ra-object intersection calculations Methods Bounding Boes Object Hierarchies Spatial Subdivision (Octrees/BSP) Tree Pruning (Randomied) 9 Uniform Spatial Partition 3D space is divided into voels of identical sie. Each voel contains a list of objects it intersects. A tradeoff eists between voel sie and list length. Disadvantage: The subdivision is totall independent of the scene structure. Advantages: Simple! The voels pierced b a ra ma be accessed ver efficientl b incremental calculation. A 3D version of Bresenham's algorithm is used. {C} {A,B} A C B {} 30 Copright Gotsman, Elber, Barequet, Karni, Sheffer Page 5

Ra Tracing Simulating Shadows Simulating Shadows Ee Image Plane Reflected Ra Light Source Trace ra from each ra-object intersection point to light source(s) If no line-of-sight point is shadowed A shadow computation routine: shadow = RaTrace(LightRa(p,obj,light)); to be included in the final shading: return Shade(shadow, ReflectColor, RefractColor, p, obj); Refracted Ra 31 3 33 34 Advanced Phenomena Ra tracers cannot simulate: Soft Shadows Fog Frequenc-dependent light. Snell s law is different for different wave-lengths Indirect light Radiosit is a global scheme complementing ra-tracing that handles S*DS* better 35 36 Copright Gotsman, Elber, Barequet, Karni, Sheffer Page 6

Ra Tracing Radiosit Some VRML Eamples Galler Chamber Models copright Lightscape, Inc. 37 38 40 Museum courtes Computer Graphics Program, Cornell Univ. 41 4 Copright Gotsman, Elber, Barequet, Karni, Sheffer Page 7

Ra Tracing 43 44 45 46 Copright Gotsman, Elber, Barequet, Karni, Sheffer Page 8