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.

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Collisions and Intersections When objects move, test for collision. When projecting surfaces, check for intersections. (Many slides adapted from Amitabh.
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.
David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
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
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Space Partitions.
Ray Tracing Outline For each pixel { Shoot ray r from eye to center of pixel with trace( r ) } function trace( r ) For each object { Find object with closest.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
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.
Spatial Data Structure: Quadtree, Octree,and BSP tree Mengxia Zhu Fall 2007.
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.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
10/02/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Octrees.
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.
Hidden Surface Removal
Ray Tracing II A More Practical Version. A QUICK REVIEW.
Computer Graphics 2 Lecture x: Acceleration Techniques for Ray-Tracing Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
1 Speeding Up Ray Tracing Images from Virtual Light Field Project ©Slides Anthony Steed 1999 & Mel Slater 2004.
Project Raytracing. Content Goals Idea of Raytracing Ray Casting – Therory – Practice Raytracing – Theory – Light model – Practice Output images Conclusion.
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.
David Luebke10/9/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
Visible-Surface Detection Jehee Lee Seoul National University.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Using BSP for CD Ref: BSP in deBerg et al ’ s book (url)url.
CS-378: Game Technology Lecture #2.2: Clipping and Hidden Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney,
Real-time Graphics for VR Chapter 23. What is it about? In this part of the course we will look at how to render images given the constrains of VR: –we.
Recursion and Data Structures in Computer Graphics Ray Tracing 1.
Implementation II.
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.
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.
Maths & Technologies for Games Spatial Partitioning 2
Advanced topics Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2006/01/04 with slides by Brian Curless, Zoran Popovic, Mario Costa Sousa.
Computer Graphics I, Fall 2010 Implementation II.
01/28/09Dinesh Manocha, COMP770 Visibility Computations Visible Surface Determination Visibility Culling.
BSP Tree Supplement Jyun-Ming Chen. Fall Kd-Tree and BSP tree kd-tree is a special kind of bsp tree.
Ray Tracing Optimizations
David Luebke 3/5/2016 Advanced Computer Graphics Lecture 4: Faster Ray Tracing David Luebke
RENDERING : Global Illumination
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”
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Ray Tracing Acceleration (3)
Basic Ray Tracing CMSC 435/634.
Bounding Volume Hierarchies and Spatial Partitioning
Photorealistic Rendering vs. Interactive 3D Graphics
Bounding Volume Hierarchies and Spatial Partitioning
Deformable Collision Detection
Modeliranje kompleksnih modelov
© University of Wisconsin, CS559 Fall 2004
CMSC 635 Ray Tracing.
CS5500 Computer Graphics May 29, 2006
Deformable Collision Detection
Ray Tracing Sung-Eui Yoon (윤성의) CS580: Course URL:
Modeliranje kompleksnih modelov
Presentation transcript:

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 and refraction. Display module (in text mode)

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-Triangle Intersection Ray: (x,y,z)=(x 1,y 1,z 1 )+t(x d,y d,z d ) Triangle: (x,y,z)=(x 1,y 1,z 1 )+u(x 01,y 01,z 01 )+v(x 02,y 02,z 02 ) Find t, u, v that produce the same (x,y,z) Intersection found if: t > 0 0 ≦ u, v ≦ 1, and u + v ≦ 1 V0V0 V1V1 V2V2

Part B due October 24 Object module –Add at least a plane type. Ray tracer module: –Add shading, reflection, and refraction. Display module: –PPM library will be provided. Add a demo scene of your own.

Lighting (Shading) & Shadow Point light is easy to implement. How to determine a surface point is in the shadow? Use a shadow ray (from intersection point to light). Shading will be introduced in the next lecture.

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

Make It Fast From Pharr’s Chapter 4 –Object subdivision (i.e., bounding volume) –Spatial subdivision (e.g., grid, octree, kd- tree) –Ray coherence.

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.

Space Partitions

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

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”

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.

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

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

Drawing Order from BSP Trees BSP tress can be used to order polygons from back to front, or visa-versa –Descend tree with viewpoint –Things on the same side of a splitting plane as the viewpoint are always in front of things on the far side Can draw from back to front –Gives the correct order for rendering transparent objects with a z-buffer, and by far the best way to do it Can draw front to back too.

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.