黃聰賢.  Program Framework  Generate Ray  Get Nearest Intersection ◦ Ray-Triangle Intersection ◦ Space Partition ◦ Ray-Box Intersection  Visibility.

Slides:



Advertisements
Similar presentations
Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Advertisements

Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
CSE 681 Bounding Volumes. CSE 681 Bounding Volumes Use simple volume enclose object(s) tradeoff for rays where there is extra intersection test for object.
Visibility in Computer Graphics Toni Sellarès Unversitat de Girona
Plain Mirror Style SNC2D
Illumination Model & Surface-rendering Method 박 경 와.
Informationsteknologi Thursday, November 22, 2007Computer Graphics - Class 111 Today’s class Clipping Parametric and point-normal form of lines Intersecting.
Ray Tracing Tutorial. Ray Casting One type of visibility algorithm.
黃聰賢.  Render Equation  BRDF  Importance Sampling  Implementation.
1 Dr. Scott Schaefer Hidden Surfaces. 2/62 Hidden Surfaces.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Part I: Basics of Computer Graphics Viewing Transformation and Coordinate Systems Chapter
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
CSC 461: Lecture 51 CSC461 Lecture 5: Simple OpenGL Program Objectives: Discuss a simple program Discuss a simple program Introduce the OpenGL program.
1 Dynamic Shadows and Lighting for Walkthrus of Large Models Brandon Lloyd COMP 258 December 2002.
Product Design Sketching Activity
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 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.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
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.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Week 13 - Wednesday CS361.
Ray Tracing II A More Practical Version. A QUICK REVIEW.
An Introduction to Ray Tracing CS /27/1998 Vic Baker.
CSE 681 Ray Tracing Geometry. The Camera Model Based on a simpile pin-hole camera model –Simplest lens model –Pure geometric optics – based on similar.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Project Raytracing. Content Goals Idea of Raytracing Ray Casting – Therory – Practice Raytracing – Theory – Light model – Practice Output images Conclusion.
Week 13 - Friday.  What did we talk about last time?  Ray/sphere intersection  Ray/box intersection  Slabs method  Line segment/box overlap test.
Plain Mirror Style SNC2D. Angles – What’s It All Mean?
The Fundamentals of Ray-Tracing Szirmay-Kalos László Dept. of Control Engineering and Information Technology Budapest University of Technology
10/15/02 (c) 2002 University of Wisconsin, CS559 Last Time Clipping.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
Using BSP for CD Ref: BSP in deBerg et al ’ s book (url)url.
How much cardboard does it take to make a cereal box? Have you ever wondered?
Binary Space Partitioning Trees Ray Casting Depth Buffering
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
10/15/02 (c) 2002 University of Wisconsin, CS559 Who Am I? Prof Stephen Chenney These notes will be online after the lecture – in fact they’re online already.
10/19/04© University of Wisconsin, CS559 Fall 2004 Last Time Clipping –Why we care –Sutherland-Hodgman –Cohen-Sutherland –Intuition for Liang-Barsky Homework.
Computer Graphics Lecture 08 Fasih ur Rehman. Last Class Ray Tracing.
CS380: Computer Graphics Distributed Ray Tracing TA Course URL:
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
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.
Find the surface area of the prism. COURSE 2 LESSON 8-8 Then find the total area of the five faces. top bottom left side front side back side 10(26) +
1 Graphics CSCI 343, Fall 2015 Lecture 18 Viewing III--More Projection.
Advanced topics Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2006/01/04 with slides by Brian Curless, Zoran Popovic, Mario Costa Sousa.
Viewing and Projection
Computer Vision Spring ,-685 Instructor: S. Narasimhan WH 5409 T-R 10:30am – 11:50am Lecture #23.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
David Luebke 3/5/2016 Advanced Computer Graphics Lecture 4: Faster Ray Tracing David Luebke
Caustics Triangles on the GPU Umenhoffer Tamás Gustavo Patow Szirmay-Kalos László.
RENDERING : Global Illumination
Ray Tracing Acceleration (5). Ray Tracing Acceleration Techniques Too Slow! Uniform grids Spatial hierarchies K-D Octtree BSP Hierarchical grids Hierarchical.
Lattice Multiplication. Step 1 1)Draw a set of 2 by 2 boxes. 46 x 79 2) Cut the boxes in half diagonally. 3) Place the numbers on the outside of the boxes.
LIGHT. One important thing to know about light is that it travels and behaves as waves. Light also has the character of a particle, but we're going to.
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”
Ray Tracing I. Reading Hill, Chapter 14, Sections 14.1 to 14.5 Hill, Chapter 14, Sections and
9.2 Surface Area of Pyramids
CDA 6938 Final Project Triangulation from Point Cloud
OpenGL API 2D Graphic Primitives
CSCE 441: Computer Graphics Hidden Surface Removal
Intro to lighting (Chapter 11)
Class 1: First Program.
Plain Mirror Style SNC2D
Presentation transcript:

黃聰賢

 Program Framework  Generate Ray  Get Nearest Intersection ◦ Ray-Triangle Intersection ◦ Space Partition ◦ Ray-Box Intersection  Visibility

Model view: only glLoadIdentity() Projection: use glLoadIdentity() and glOrtho(…) For i from 0 to screen_width-1 For j from 0 to screen_height-1 Ray r = GenerateRay( … ); Point p = GetNearestIntersection(r); pixel_color = ComputeColor(p); glBegin(GL_POINTS); glColor3f(pixel_color); glVertex2i(i,j); glEnd();

 Input ◦ Eye :  position, direction, up direction ◦ The position of the pixel in the screen :  (i, j) ◦ The screen resolution :  screen_width, screen_height ◦ Projection setting:  near, right, left, top, bottom  Output ◦ Ray :  start position, direction

Right Top eye up eye direction R 3 Frustum near, right, top R 2 Screen Resolution : W * H Right = normalize(eye direction × up direction) Top = normalize(Right × eye direction) (P.S. top ≠ up) Ray direction = normalize ( near * normalize(eye direction) +[(i-W/2)/(W/2)]*right*Right +[(j-H/2)/(H/2)]*top*Top ) (0,0) W H i j pixel(i,j) right top Ray near (W/2,H/2)

Input : Ray r; Output : Nearest intersection point p; Point temp_point; float t; float distance = FLT_MAX; For each face f { t = ray_triangle(&f, &r, &tmp_point); if( t ε) { distance = t; p = temp_point; }

=>=> =>=>

=>=>

 Octree  KD-Tree

t y min t y max t x min t x max t y min t y max t x min

a c : center of box a i : normalized side direction of box h i : positive half length of box

 Shoot a ray to the light and try to get the distance to the nearest intersection point.  If the distance > the distance to the light, add the lighting effect  Space partition can speed up the computation.

eye d_L d_hit d_L < d_hit, visibility = 1 light eye d_L d_hit d_L > d_hit, visibility = 0 light pixel p

eye x y0y0 y1y1 yiyi ω0ω0 ω1ω1 ωiωi light

 Use Phong Lighting Model.  Add the lighting effect if visibility is one. N E R L I * (Kd * dot(N, L) + Ks * pow(dot(E, R), Ns) )

 Use importance sampling to choose direction  If the direction hits a point y i, compute the y i direct lighting eye x y0y0 y1y1 yiyi normal ω0ω0 ω1ω1 ωiωi