Intro to Ray-Tracing & Ray-Surface Acceleration

Similar documents
Accelerating Ray-Tracing

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

Ray Tracing I: Basics

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

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

CS348B Lecture 2 Pat Hanrahan, Spring Greeks: Do light rays proceed from the eye to the light, or from the light to the eye?

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

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

Computer Graphics. - Ray Tracing I - Marcus Magnor Philipp Slusallek. Computer Graphics WS05/06 Ray Tracing I

Ray Tracing. Brian Curless CSEP 557 Fall 2016

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

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

CPSC GLOBAL ILLUMINATION

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

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

Ray Tracing. CPSC 453 Fall 2018 Sonny Chan

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

Review for Ray-tracing Algorithm and Hardware

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

Geometric optics. The University of Texas at Austin CS384G Computer Graphics Don Fussell

Other Rendering Techniques CSE 872 Fall Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity CSE 872 Fall

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

Sung-Eui Yoon ( 윤성의 )

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Reading. Ray Tracing. Eye vs. light ray tracing. Geometric optics. Required: Watt, sections , (handout) Further reading:

The Rasterization Pipeline

COMP371 COMPUTER GRAPHICS

Computer Graphics and Image Processing Ray Tracing I

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

Pipeline Operations. CS 4620 Lecture 10

Photorealism: Ray Tracing

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Reading. Ray Tracing. Eye vs. light ray tracing. Geometric optics. Required:

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

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

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

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

SUMMARY. CS380: Introduction to Computer Graphics Ray tracing Chapter 20. Min H. Kim KAIST School of Computing 18/05/29. Modeling

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

Pipeline Operations. CS 4620 Lecture 14

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

Ray Tracing. Outline. Ray Tracing: History

Lecture 10: Ray tracing

Topics and things to know about them:

Lecture 11: Ray tracing (cont.)

Illumination Algorithms

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

Ray Tracing Foley & Van Dam, Chapters 15 and 16

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

Supplement to Lecture 16

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Computer Graphics. - Introduction to Ray Tracing - Philipp Slusallek

Last week. Machiraju/Zhang/Möller

CS-184: Computer Graphics. Administrative

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

Photorealistic 3D Rendering for VW in Mobile Devices

Global Illumination. Why Global Illumination. Pros/Cons and Applications. What s Global Illumination

Texture Mapping II. Light maps Environment Maps Projective Textures Bump Maps Displacement Maps Solid Textures Mipmaps Shadows 1. 7.

Assignment 6: Ray Tracing

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

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

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

Lecture 11. More Ray Casting/Tracing

CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer. by Emmanuel Agu

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

Ray-Tracing. Misha Kazhdan

Luxo Jr. (Pixar, 1986) Last Time. Real Cameras and Ray Tracing. Standard Rasterization. Lights, Cameras, Surfaces. Now Playing:

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Review. Stephen J. Guy

Shading, Advanced Rendering. Week 7, Wed Feb 28

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

The Rendering Equation & Monte Carlo Ray Tracing

Lighting and Shading

Real-Time Shadows. Last Time? Today. Why are Shadows Important? Shadows as a Depth Cue. For Intuition about Scene Lighting

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

Ray Tracing. Shandong University

The Traditional Graphics Pipeline

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

The Traditional Graphics Pipeline

For Intuition about Scene Lighting. Today. Limitations of Planar Shadows. Cast Shadows on Planar Surfaces. Shadow/View Duality.

Programming projects. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Ray Casting. Outline. Similar to glulookat derivation. Foundations of Computer Graphics

Last Time? Ray Casting. Administrivia: Lab & Office Hours. Notes on Assignments. Ray Casting. Overview of Today

Viewing and Ray Tracing. CS 4620 Lecture 4

Computer Graphics. Lecture 02 Graphics Pipeline. Edirlei Soares de Lima.

Point Cloud Filtering using Ray Casting by Eric Jensen 2012 The Basic Methodology

Chapter 7 - Light, Materials, Appearance

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Introduction to Ray-tracing Objectives

The Traditional Graphics Pipeline

CHAPTER 1 Graphics Systems and Models 3

A Little Background. Motivation. Motivation

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

Questions??? Announcements Assignment 3 due today

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

Ray tracing Tutorial. Lukas Herzberger

Viewing and Ray Tracing

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

Spring 2012 Final. CS184 - Foundations of Computer Graphics. University of California at Berkeley

Transcription:

Lecture 12 & 13: Intro to Ray-Tracing & Ray-Surface Acceleration Computer Graphics and Imaging UC Berkeley

Course Roadmap Rasterization Pipeline Core Concepts Sampling Antialiasing Transforms Geometric Modeling Core Concepts Splines, Bezier Curves Topological Mesh Representations Subdivision, Geometry Processing Rasterization Transforms & Projection Texture Mapping Visibility, Shading, Overall Pipeline Intro to Geometry Curves and Surfaces Geometry Processing Today: Ray-Tracing & Acceleration Lighting & Materials Cameras & Imaging

Basic Ray-Tracing Algorithm

Light Rays Three ideas about light rays 1. Light travels in straight lines (mostly) 2. Light rays do not interfere with each other if they cross (photons do not have interactions; ignoring wave effects like interference) 3. Light rays travel from the light sources to the eye (but the physics is invariant under path reversal - reciprocity).

Ray Casting Appel 1968 - Ray casting 1. Generate an image by casting one ray per pixel 2. Check for shadows by sending a ray to the light

Ray Casting - Generating Eye Rays Pinhole Camera Model eye ray (starts at eye and goes through pixel) closest scene intersection point note: more intersection points eye point image plane light source

Ray Casting - Shading Pixels (Local Only) Pinhole Camera Model eye ray (starts at eye and goes through pixel) eye point image plane perform shading calculation here to compute color of pixel (e.g. Blinn Phong model) light source

Discussion: Ray Casting vs Rasterization Remember: Rasterization: 4x4 perspective matrix, project triangles to 2D screen, rasterize pixels Ray Casting: shoot rays through pixels into scene, intersect with triangles Discussion topics: Will they make the same picture? Which algorithm is faster, when? Other pros/cons? When would you use each algorithm, and why?

Discussion: Ray Casting vs Rasterization Will they make the same picture? Which algorithm is faster, when? Other pros/cons? When would you use each algorithm, and why? Ray approach better shaded than the rasterization? Shadows, sense of depth? Ray casting would be inefficient with respect to occlusion What happens when light is at the eye? Probably the same image? Because the same shading models? Transparency might change equivalence between models Ray casting, for every pixel must intersect against all triangles, very slow! Might need O(log n) algorithm, n number of triangles.

Recursive Ray Tracing An improved Illumination model for shaded display T. Whitted, CACM 1980 Time: VAX 11/780 (1979) 74m PC (2006) 6s GPU (2012) 1/30s Spheres and Checkerboard, T. Whitted, 1979

Recursive Ray Tracing eye point image plane light source

Recursive Ray Tracing Mirror ray (specular reflection) eye point image plane light source

Recursive Ray Tracing Refractive rays (specular transmission) eye point image plane light source

Recursive Ray Tracing eye point image plane light source Shadow rays

Recursive Ray Tracing secondary rays primary ray eye point image plane light source shadow rays Trace secondary rays recursively until hit a non-specular surface (or max desired levels of recursion) At each hit point, trace shadow rays to test light visibility (no contribution if blocked) Final pixel color is weighted sum of contributions along rays, as shown Gives more sophisticated effects (e.g. specular reflection, refraction, shadows), but we will go much further to derive a physically-based illumination model

Recursive Ray Tracing

Ray-Surface Intersection

Ray Intersection With Triangle Mesh Why? Rendering: visibility, shadows, lighting Geometry: inside/outside test How to compute? Let s break this down: Simple idea: just intersect ray with each triangle Simple, but slow (accelerate next time) Note: can have 0, 1 or multiple intersections

Ray Equation Ray is defined by its origin and a direction vector Example: Ray equation: 0 apple t<1 point along ray time origin unit direction

Plane Equation Plane is defined by normal vector and a point on plane Example: p 0 ) Plane Equation: 0 p :(p p 0 ) N =0 ax + by + cz + d =0 all points on plane any point normal vector

Ray Intersection With Plane Ray equation: r(t) =o + t d, 0 apple t<1 0 Plane equation: p :(p p 0 ) N =0 p 0 ) Solve for intersection Set p = r(t) and solve for t (p p 0 ) N =(o + t d p 0 ) N =0 t = (p0 o) N Check: 0 apple t<1 d N

Ray Intersection With Triangle Triangle is in a plane Ray-plane intersection Test if hit point is inside triangle (Assignment 1!) Many ways to optimize

Möller Trumbore Algorithm Why care about performance?

Ray Intersection With Sphere Ray: r(t) =o + t d, 0 apple t<1 0 Sphere: p :(p c) 2 R 2 =0 (p R 2 c) Solve for intersection: (o + t d c) 2 R 2 =0 at 2 + bt+ c =0, where t = b ± p b 2 4ac 2a a = d d b = 2(o c) d c =(o c) (o c) R 2

Ray Intersection With Implicit Surface Ray: 0 r(t) =o + t d, 0 apple t<1 General implicit surface: p : f(p) =0 Substitute ray equation: f(o + t d) =0 Solve for real, positive roots

Accelerating Ray-Surface Intersection

Ray Tracing Performance Challenges Simple ray-scene intersection Exhaustively test ray-intersection with every object Problem: Exhaustive algorithm = #pixels #objects Very slow!

Ray Tracing Performance Challenges Jun Yan, Tracy Renderer San Miguel Scene, 10.7M triangles

Ray Tracing Performance Challenges Deussen et al; Pharr & Humphreys, PBRT Plant Ecosystem, 20M triangles

Discussion: Accelerating Ray-Scene Intersection Deussen et al; Pharr & Humphreys, PBRT Next time: Brainstorm 3-4 accelerations, small or big ideas

To Be Continued

Acknowledgments Thanks to Pat Hanrahan, Kayvon Fatahalian, Mark Pauly and Steve Marschner for lecture resources.