COMP30019 Graphics and Interaction Ray Tracing

Similar documents
Ray-Tracing. Misha Kazhdan

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

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

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

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

COMP371 COMPUTER GRAPHICS

Lecture 11: Ray tracing (cont.)

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Indirect Illumination

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

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

Ray Tracing. Kjetil Babington

Lecture 7 Notes: 07 / 11. Reflection and refraction

Hidden surface removal. Computer Graphics

Indirect Illumination

Lecture 10: Ray tracing

Outline The Refraction of Light Forming Images with a Plane Mirror 26-3 Spherical Mirror 26-4 Ray Tracing and the Mirror Equation

Lecture 19: All Together with Refraction

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

Introduction to Visualization and Computer Graphics

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

Computer Graphics Lecture 11

Supplement to Lecture 16

Clipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

specular diffuse reflection.

Real-Time Shadows. André Offringa Timo Laman

LIGHT. Speed of light Law of Reflection Refraction Snell s Law Mirrors Lenses

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

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

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

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

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Graphics and Interaction Rendering pipeline & object modelling

Photorealism: Ray Tracing

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

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

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

11.2 Refraction. December 10, Wednesday, 11 December, 13

Reflection and Shading

Today s Topic: Refraction / Snell s Law

CEng 477 Introduction to Computer Graphics Fall 2007

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

CPSC GLOBAL ILLUMINATION

Computer Graphics. Bing-Yu Chen National Taiwan University

REFLECTION & REFRACTION

Chapter 26 Geometrical Optics

Light and the Properties of Reflection & Refraction

Raytracing. COSC 4328/5327 Scott A. King

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

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

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

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

9. Illumination and Shading

COMPLETION OF Z-buffer Graphics Pipeline

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

9. Visible-Surface Detection Methods

PHY 112: Light, Color and Vision. Lecture 11. Prof. Clark McGrew Physics D 134. Review for Exam. Lecture 11 PHY 112 Lecture 1

Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies" Ø The Hall illumination model. Ø Original ray tracing paper

Ray tracing. EECS 487 March 19,

CS 6620 Shading. Steve Parker Peter Shirley

Graphics for VEs. Ruth Aylett

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

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2

782 Schedule & Notes

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

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

Hidden Surface Removal

Comp 410/510 Computer Graphics. Spring Shading

Shading, Advanced Rendering. Week 7, Wed Feb 28

Computer Graphics 10 - Shadows

Lecture Ray Model of Light. Physics Help Q&A: tutor.leiacademy.org

Interpolation using scanline algorithm

Reflection and Refraction of Light

Computer Graphics. Shadows

Lighting and Shading

Identifying those parts of a scene that are visible from a chosen viewing position, and only process (scan convert) those parts

Lab 10 - GEOMETRICAL OPTICS

Practical Techniques for Ray Tracing in Games. Gareth Morgan (Imagination Technologies) Aras Pranckevičius (Unity Technologies) March, 2014

Physics Experiment 13

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

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

CS 428: Fall Introduction to. Raytracing. Andrew Nealen, Rutgers, /18/2009 1

Phys 102 Lecture 17 Introduction to ray optics

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

Purpose: To determine the index of refraction of glass, plastic and water.

Recap: Refraction. Amount of bending depends on: - angle of incidence - refractive index of medium. (n 2 > n 1 ) n 2

Lighting and Reflectance COS 426

Illumination. Courtesy of Adam Finkelstein, Princeton University

Ray Tracing. CS116B Chris Pollett Apr 20, 2004.

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

Reflection and Refraction

Realistic Camera Model

Implementation Issues

COMP environment mapping Mar. 12, r = 2n(n v) v

Reflection and Refraction

03 RENDERING PART TWO

Light and Lenses Notes

Review for Ray-tracing Algorithm and Hardware

Optics. a- Before the beginning of the nineteenth century, light was considered to be a stream of particles.

Spatial Data Structures

Transcription:

COMP30019 Graphics and Interaction Ray Tracing Department of Computer Science and Software Engineering The

Lecture outline Ray tracing Recursive Ray Tracing Binary Space Partition (BSP) Trees Refraction Transparency Shadow volumes & the Stencil Buffer

What alternatives are there to the rendering pipeline approach? Aim: understand the computational implications of ray tracing and the radiance illumination model. Reading: 13.4 Visible-surface ray tracing and 14.7 Recursive Ray tracing and Foley Sections 12.4.8 Shadows.

Alternative to rendering pipeline: Ray tracing Idea is simple: tracing backwards the path of each ray of light entering the camera to find out what objects it encountered, and what light sources it came from! 1. Each pixel in the created image corresponds to a line of sight. 2. Start from image not polygon or object as in rendering pipeline approach. 3. We can trace back this line of sight (ray) to find the nearest object surface it intersects. At this inter point, we can check for visibility of light sources, and compute Lambertian, ambient, and specular contributions to our ray.

Recursive rays T 2 R 2 N 2 N i Surface normal R 1 T 1 N 3 R 3 R i Reflected ray L i Shadow ray L 2 L 3 L 1 T i Transmitted ray N 1 Viewpoint Point light source (Foley Figure 14.35)

fxguide: A SSS render using Lightstage data

Real-time ray tracing? The cardinality (or size) of the ray tracing problem is determined by the number of pixels in the image or viewport, as opposed to the number of polygons in the scene as in the rendering pipeline approach. In addition, ray tracing is made more computationally intensive by the recursive nature of ray tracing (depending upon what order you assume in terms of how many re-reflections of rays you cater for).

Octane Render: raltime ray tracing

Octane Render: realtime ray tracing

Some real-time ray tracing techiques Quite a large number of approaches to speed up. Pre-baking, OpenRL (low level interactive ray tracing API), Bounding volumes, e.g. Binary space parition trees (BSPs)...

World space scene intersection in Unity 5 http://www.gdcvault.com/play/1020688/ Practical-Techniques-for-Ray-Tracing

Binary Space Partition (BSP) Trees Binary partition sort (akin to quicksort): Choose a face Partition other faces into those closer or farther than the plane of this face (cutting faces where they straddle the partitioning plane) Recursively work on the partitions, until single faces Note: This partitioning structure (tree) is invariant to change of viewpoint

A BSP tree representation in two-dimensions (2D) f a c e d b i h j (a) g k in a b j c e k out d out f g in out out in out h out in i in out (b) (a) A concave polygon bounded by black lines.(b) The BSP tree. Foley Figure 10.19 Lines defining the half-spaces are dark grey, and in cells are light grey.

The BSP tree algorithm is an extremely efficient method for calculating the visibility relationships among a static group of 3D polygons as seen from an arbitrary viewpoint. Remarkably, the BSP tree can be traversed in a modified in-order tree walk to yield a correct priority ordered polygon list. Based on relationship to polygons surface normal. unlike other approaches where data structures need re-calculating (note, if using z-buffering, or scan-line variant rely on sortedness of polygons, and as viewpoint changes will need to re-sort these lists. Downside: need to pre-process all polygons.

Refraction When going from one medium to another, a ray of light will be bent at the intermediate surface. This bending, refraction, is governed by Snell s Law: sin θ i sin θ t = η tλ η iλ where θ i is the angle of incidence, θ t is the angle of refraction and η tλ and η iλ are the indices of refraction of each material as a function of wavelength λ. Notice that, for a solid piece of transparent material, light will be refracted both on entering and leaving the material.

Calculating the Refraction vector N cosθ i I N I N cosθ i θ i sinθ t M θ t M = (N cosθ i I) /sinθ i cos θ t N N T = sinθ t M cosθ t N (Foley Figure 14.32)

Transparency Some of this loss is from reflection at the surfaces as the light enters and leaves the object. This is the factor t. The rest of the loss is from absorption within the transparent material. A constant increase in path length within the material reduces the light by a constant factor, leading to an exponential behaviour. T = te ad where a is parameter, and d is the distance travelled within the material. Note, because light may take an oblique path, the distance d is not usually the same as the thickness of the material.

Ray tracing Recursive Ray Tracing Binary Space Partition (BSP) Trees Refraction Transparency Shadow volumes & the Stencil

Shadow volumes & the Stencil Buffer Light Object C B A A front facing shadow polygon, A or B in above Figure, causes polygons behind it to be shadowed. (Foley Figure 14.28)

Scan-line generation of shadows Light A A Current scan line a b c d B Viewer (Foley Figure 14.27)

Stencil buffer & Shadow Volumes toolkit - Unity