Ray Tracing II A More Practical Version. A QUICK REVIEW.

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.
Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Lecture 14 Illumination II – Global Models
Ray Tracing CMSC 635. Basic idea How many intersections?  Pixels  ~10 3 to ~10 7  Rays per Pixel  1 to ~10  Primitives  ~10 to ~10 7  Every ray.
Local Reflection Model Jian Huang, CS 594, Fall 2002.
Advanced Computer Graphics (Spring 2013) CS 283, Lecture 8: Illumination and Reflection Many slides courtesy.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Ray Tracing Variants Distributed ray tracing Generalized rays Cone Tracing Beam Tracing Pencil.
Christian Lauterbach COMP 770, 2/11/2009
University of Texas at Austin CS395T - Advanced Image Synthesis Spring 2006 Don Fussell Previous lecture Reflectance I BRDF, BTDF, BSDF Ideal specular.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
Computer Graphics (Spring 2008) COMS 4160, Lecture 20: Illumination and Shading 2
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
Part I: Basics of Computer Graphics
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Space Partitions.
Bounding Volume Hierarchies and Spatial Partitioning Kenneth E. Hoff III COMP-236 lecture Spring 2000.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
1 Advanced Scene Management System. 2 A tree-based or graph-based representation is good for 3D data management A tree-based or graph-based representation.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
CSC418 Computer Graphics n Raytracing n Shadows n Global Illumination.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
Computer Graphics 2 Lecture x: Acceleration Techniques for Ray-Tracing Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
1 Speeding Up Ray Tracing Images from Virtual Light Field Project ©Slides Anthony Steed 1999 & Mel Slater 2004.
-Global Illumination Techniques
Graphics Graphics Korea University cgvr.korea.ac.kr Solid Modeling 고려대학교 컴퓨터 그래픽스 연구실.
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
The Fundamentals of Ray-Tracing Szirmay-Kalos László Dept. of Control Engineering and Information Technology Budapest University of Technology
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.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
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.
MIT EECS 6.837, Durand and Cutler Acceleration Data Structures for Ray Tracing.
Advanced Illumination Models Chapter 7 of “Real-Time Rendering, 3 rd Edition”
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Ray Tracer Spring 2008 Help Session. Outline Project Web Resources What do you have to do for this project? Ray Class Isect Class Requirements Tricks.
Announcements Office hours today 2:30-3:30 Graded midterms will be returned at the end of the class.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Material Representation K. H. Ko School of Mechatronics Gwangju Institute.
Computer Graphics (Spring 2003) COMS 4160, Lecture 18: Shading 2 Ravi Ramamoorthi Guest Lecturer: Aner Benartzi.
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.
Advanced topics Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2006/01/04 with slides by Brian Curless, Zoran Popovic, Mario Costa Sousa.
02/2/05© 2005 University of Wisconsin Last Time Reflectance part 1 –Radiometry –Lambertian –Specular.
MIT EECS 6.837, Durand and Cutler Acceleration Data Structures for Ray Tracing.
Local Reflection Models
Ray Tracing Optimizations
David Luebke 3/5/2016 Advanced Computer Graphics Lecture 4: Faster Ray Tracing David Luebke
Global Illumination (3) Photon Mapping (1). Overview Light Transport Notation Path Tracing Photon Mapping –Photon Tracing –The Photon Map.
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.
David Luebke3/12/2016 Advanced Computer Graphics Lecture 3: More Ray Tracing David Luebke
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Distributed Ray Tracing. Can you get this with ray tracing?
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.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
1 Geometry for Game. Geometry Geometry –Position / vertex normals / vertex colors / texture coordinates Topology Topology –Primitive »Lines / triangles.
Basic Ray Tracing CMSC 435/634.
Bounding Volume Hierarchies and Spatial Partitioning
Photorealistic Rendering vs. Interactive 3D Graphics
Bounding Volume Hierarchies and Spatial Partitioning
© University of Wisconsin, CS559 Fall 2004
Previous lecture Reflectance I BRDF, BTDF, BSDF Ideal specular model
CS5500 Computer Graphics May 29, 2006
GR2 Advanced Computer Graphics AGR
Ray Tracing Sung-Eui Yoon (윤성의) CS580: Course URL:
Distributed Ray Tracing
Presentation transcript:

Ray Tracing II A More Practical Version

A QUICK REVIEW

Creating a Ray Parameters: –Image Plane (position, size, and resolution) –Viewpoint –Which ray (x, y)?

Ray-Object Intersection For example: sphere (x-x 0 ) 2 +(y-y 0 ) 2 +(z-z 0 ) 2 =r 2 Ray: (x,y,z)=(x 1,y 1,z 1 )+t(x d,y d,z d ) Find t that satisfy (x-x 0 ) 2 +(y-y 0 ) 2 +(z-z 0 ) 2 =r 2 Normal vector? Also easy for planes, cones, …etc.

Ray-Object Intersection Plane: (x,y,z)= V 0 + s 1 *V 1 + s 2 *V 2 Ray: (x,y,z)= (x 1,y 1,z 1 ) + t (x d,y d,z d ) Find s 1, s 2, t that produce the same (x,y,z) Intersection found if 0  s 1, s 2  1 and t > 0 V1V1 V2V2 V0V0

Ray-Triangle Intersection Intersection found if: t > 0 and s 1 +s 2  1 Now you can handle 3D OBJ models!! V0V0 V1V1 V2V2

SHADING, REFLECTION, REFRACTION

Shading Models Pixel color = ambient + diffuse + specular + reflected + transmitted The weight of each is determined by the surface properties.

Diffuse Component Id = Ii * N·L Not affected by viewing direction. –i.e., incoming light is reflected to all directions. N L

Glossy (Specular) Component (Phong Reflection Model) To model imperfect reflection. Is = Ii(N · H) n N L V H

Phong Reflection Model I = Ka*Ia + kd*Id + Ks*Is Not completely correct, but good enough. ambient diffuse specular

“But, they all look like plastic…”

Other Reflection Models Pharr’s 9.4: other microfacet models –Oren-Nayar –Torrance-Sparrow –Blinn microfacet distribution –Anisotropic microfacet model Pharr’s 9.5: Lafortune model Models for particular materials: e.g., for finished wood (in SIGGRAPH 2005)

Specular Component (Cook & Torrance Model) Consider specular reflection as perfect reflection of micro-facets. (See Watt’s Section 7.6) Specular= DGF /( N·V) D: Distribution term G: Geometry (shadowing and masking) term F: Fresnel term

Lafortune Model Phong model assumes the glossy reflection (lobe) appears in the direction opposite to the incident light. This assumption is relaxed in the Lafortune model. Multiple lobes can be used.

“Now, are all materials covered?” No! Let’s try a sample-based method instead…

BRDF BRDF=f(  in,  in,  ref,  ref )=f(L,V)

Watch Out for Subtly in BRDF! Ask yourself these questions: –Why not just consider N · H as in the Phong’s glossy term? (Hint: Does incidence matter?) –Does  in really matter? Difference between isotropic and anisotropic reflection!

Why Not Always Using BRDF? Difficult to find a “closed form” representation of BRDF. The Phong model and Cook & Torrance model are approximation of BRDF. –They are not 100% match of BRDF, but they are easy to compute.

Local vs. Global Illumination Local – each surface is influenced by the light source only. Global – each surface is influenced by the light source AND ALL OTHER surfaces.

Reflection and Refraction Reflected ray is determined by: – incoming ray and normal vector. Refracted ray is determined by: –Incoming ray –Normal vector –And density Snell’s law:  I sin  i =  t sin  t ii tt

Advanced Ray Tracing Make it fast. Make it better. –Anti-aliasing –Distributed Ray Tracing

Anti-Aliasing Super(or Over)-sampling Adaptive vs. Non-adaptive Uniform vs. Jittered Detail coming in a future lecture

Distributed Ray Tracing Published by R. L. Cook in Antialiasing Motion blur Depth of field (camera) Ideas behind other so-called Monte Carlo methods.

ACCELERATION

Common Operations in 3D Line/object intersection –Given a ray or line, which object will it intersect? View frustum culling Collision detection

A Motivating Problem Which one of the following takes more time to render? A small bunny –With more than 10K triangles. –Covers about 5% of the screen A large sphere –Covers about 50% of the screen Why spending so much time with so little gain?

Bounding Volumes The following shows a triangle and its (axis-aligned) bounding box. Is it faster to check the intersection with a bounding box or triangle? What about an object with many triangles? Can we use other shape as the bounding volume?

Sorting/Indexing in 3D Sequential search is too slow for large models. How about storing them in a 3D array? –Size will be overwhelming Think “hierarchy”

Grid Simply divide the bounding box of the whole 3D space into NxNxN uniform sized boxes (or voxels). Note that a primitive may overlap with many voxels. Q: What is the potential speedup? Q: What is the magic number N?

Octree Divide the space in halves in X/Y/Z. –Always split in the middle. –You may also consider them as splitting in X, then in Y, then in Z. If too many objects are in a partition, divide them again (recursively).

K-D Tree More flexible than octree: –Not always splitted in the middle. –Split in X, then in Y, then in Z, or any order. Rules to select the split positions? –Considering the number of primitives? –How about the size or surface area? –A popular choice is the Surface Area Heuristic (SAH)

Kd-tree Example Figure Source: CS638 slides by Stephen Chenney, University of Wisconsin – Madison,

BVH (Bounding Volume Hierarchy) The spatial hierarchy adheres to the objects more closely than grid, kd-tree, …etc. The bounding volume is not limited to axis- aligned boxes. Creative CommonsCreative Commons Attribution-Share Alike 3.0 Unported licenseAttribution-Share Alike 3.0 Unported Source:

Accelerator Grid, kd-tree, octree, bounding volume hierarchy (BVH)…etc. are examples of “accelerators” For more details, see Chapter 4 of PBRT 2 nd Edition.

Speed Considerations Q1: Is intersection test with a box fast? –Nearly trivial for axis-aligned boxes! Q2: How about cross-boundary objects? –Add a “visited” Boolean flag. Q3: What is the computational complexity? –O(log N) intuitively speaking

Optional (Backup) Slides

BSP Trees From the paper by Fuchs et al, “On visible surface generation by a priori tree structures” SIGGRAPH 80.On visible surface generation by a priori tree structures Binary Space Partition trees –A sequence of cuts that divide a region of space into two Cutting planes can be of any orientation

BSP Example BAout8 D 6 C A B C D Figure Source: CS638 slides by Stephen Chenney, University of Wisconsin – Madison,

OBB Tree OBB stands for Oriented Bounding Box. OBB is a rectangular bounding box at an arbitrary orientation. Asymptotically faster for close proximity situations.