Supplement to Lecture 16

Similar documents
Ray Tracing. Shandong University

Lecture 15: Shading-I. CITS3003 Graphics & Animation

COMP371 COMPUTER GRAPHICS

Introduction to Computer Graphics 7. Shading

Comp 410/510 Computer Graphics. Spring Shading

Photorealism: Ray Tracing

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

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

Shading. Why we need shading. Scattering. Shading. Objectives

Shading I Computer Graphics I, Fall 2008

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

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Lecture 11: Ray tracing (cont.)

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

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

Illumination & Shading

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

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

Illumination Models III: Ray Tracing (View Dependent Global Illumination)

Ray casting. Ray casting/ray tracing

Computer Graphics. Ray Tracing. Based on slides by Dianna Xu, Bryn Mawr College

Lecture 10: Ray tracing

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

WHY WE NEED SHADING. Suppose we build a model of a sphere using many polygons and color it with glcolor. We get something like.

Lighting and Shading

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

Lecture 12: Advanced Rendering

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

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

Reflection and Shading

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

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

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

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

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

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

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

Illumination & Shading: Part 1

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

Overview. Shading. Shading. Why we need shading. Shading Light-material interactions Phong model Shading polygons Shading in OpenGL

Sung-Eui Yoon ( 윤성의 )

CS452/552; EE465/505. Intro to Lighting

Last week. Machiraju/Zhang/Möller

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

CPSC GLOBAL ILLUMINATION

Implementation Issues

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

1999, Denis Zorin. Ray tracing

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

CS 4600 Fall Utah School of Computing

A Little Background. Motivation. Motivation

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

Virtual Reality for Human Computer Interaction

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

Intro to Ray-Tracing & Ray-Surface Acceleration

3D Rendering. Course Syllabus. Where Are We Now? Rendering. 3D Rendering Example. Overview. Rendering. I. Image processing II. Rendering III.

CS 6620 Shading. Steve Parker Peter Shirley

Questions??? Announcements Assignment 3 due today

Ray Tracing. Local Illumination. Object Space: Global Illumination. Image Space: Backward Ray Tracing. First idea: Forward Ray Tracing

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

Ray Tracing. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen

Surface Rendering Methods

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

Ray-Tracing. Misha Kazhdan

Computer Graphics and Image Processing Ray Tracing I

Introduction to Visualization and Computer Graphics

Raytracing. COSC 4328/5327 Scott A. King

3D Rendering and Ray Casting

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

Objectives. Shading II. Distance Terms. The Phong Reflection Model

Shading Intro. Shading & Lighting. Light and Matter. Light and Matter

Ray Tracing COMP575/COMP770

6. Illumination, Lighting

CS 325 Computer Graphics

Shading. Shading = find color values at pixels of screen (when rendering a virtual 3D scene).

Shading, Advanced Rendering. Week 7, Wed Feb 28

3D Rendering and Ray Casting

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

CS770/870 Spring 2017 Color and Shading

Lecture 19: All Together with Refraction

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

lecture 18 - ray tracing - environment mapping - refraction

Objectives. Introduce Phong model Introduce modified Phong model Consider computation of required vectors Discuss polygonal shading.

Introduction to Ray-tracing Objectives

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

Geometric Queries for Ray Tracing

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

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

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Reflection and Transmission

Shading II. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

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

CHAPTER 1 Graphics Systems and Models 3

Ray Tracing. Brian Curless CSEP 557 Fall 2016

Objectives. Continue discussion of shading Introduce modified Phong model Consider computation of required vectors

Illumination. Courtesy of Adam Finkelstein, Princeton University

Review for Ray-tracing Algorithm and Hardware

Rendering. Generate an image from geometric primitives II. Rendering III. Modeling IV. Animation. (Michael Bostock, CS426, Fall99)

Lighting and Reflectance COS 426

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

Transcription:

Supplement to Lecture 16 Global Illumination: View Dependent CS 354 Computer Graphics http://www.cs.utexas.edu/~bajaj/ Notes and figures from Ed Angel: Interactive Computer Graphics, 6 th Ed., 2012 Addison Wesley Department of Computer Science University of Texas at Austin Jan 2010

Local vs Global Illumination OpenGL is based on a pipeline model in which primitives are rendered one at time - No shadows (except by tricks or multiple renderings) - No multiple reflections Global approaches - Rendering equation - Ray tracing - Radiosity CS 354 Computer Graphics http://www.cs.utexas.edu/~bajaj/ Notes and figures from Ed Angel: Interactive Computer Graphics, 6 th Ed., 2012 Addison Wesley Department of Computer Science University of Texas at Austin Jan 2010

Ray Tracing/Casting-1 Follow rays of light from a point source Can account for reflection and transmission However, scattering produces many (infinite) additional rays CS 354 Computer Graphics http://www.cs.utexas.edu/~bajaj/ Notes and figures from Ed Angel: Interactive Computer Graphics, 6 th Ed., 2012 Addison Wesley Department of Computer Science University of Texas at Austin Jan 2010

Ray Tracing/Casting-2 Only rays that reach the eye matter Reverse direction and cast rays Need at least one ray per pixel

Ray Tracing/Casting a Ray is parametric Sphere Sphere is quadric Resulting equation is a scalar quadratic equation which gives entry and exit points of ray (or no solution if ray misses)

Shadow Rays Even if a point is visible, it will not be lit unless we can see a light source from that point Cast shadow or feeler rays

Reflection/Transmission Must follow shadow rays off reflecting or transmitting surfaces - Ray Trees Ray Tree Traversal - Process is recursive

Diffuse Surfaces Theoretically the scattering at each point of intersection generates an infinite number of new rays that should be traced In practice, we only trace the transmitted and reflected rays but use the Phong model to compute shade at point of intersection Radiosity works best for perfectly diffuse (Lambertian) surfaces

Building a Ray Tracer Best expressed recursively Can remove recursion later Image based approach - For each ray. Find intersection with closest surface - Need whole object database available - Complexity of calculation limits object types Compute lighting at surface Trace reflected and transmitted rays

When to stop Some light will be absorbed at each intersection - Track amount left Ignore rays that go off to infinity - Put large sphere around problem Count steps

Recursive Ray Tracer I

Recursive Ray Tracer II

Recursive Ray Tracer III

Computing Intersections Implicit Objects - Quadrics Planes Polyhedra Parametric Surfaces

Implicit Surfaces Ray from p 0 in direction d p(t) = p 0 +t d General implicit surface f(p) = 0 Solve scalar equation f(p(t)) = 0 General case requires numerical methods

Quadrics General quadric can be written as p T Ap + b T p +c = 0 Substitute equation of ray p(t) = p 0 +t d to get quadratic equation

Sphere (p p c ) (p p c ) r 2 = 0 p(t) = p 0 +t d p 0 p 0 t 2 + 2 p 0 (d p 0 ) t + (d p 0 ) (d p 0 ) r 2 = 0

Planes p n + c = 0 p(t) = p 0 +t d t = -(p 0 n + c)/ d n

Polyhedra Generally we want to intersect with closed objects such as polygons and polyhedra rather than planes Hence we have to worry about inside/ outside testing For convex objects such as polyhedra there are some fast tests

Ray Intersection with Polyhedron If ray enters an object, it must enter a front facing polygon and leave a back facing polygon Polyhedron is formed by intersection of planes Ray enters at furthest intersection with front facing planes Ray leaves at closest intersection with back facing planes If entry is further away than exit, ray must miss the polyhedron

Ray Intersection with a Polyhedron

Ray Intersection with a Polygon

Ray Intersection with a Polygon

Ray Transmission Vectors Ray tracers can make use of all these effects in a global calculation by tracing rays R N L T -N

Refraction With pure refraction, all the light is transmitted but the angle of refraction is determined by Snell s law ή l sin θ l = ή t sin θ t where ή l and ή t are the speed of light relative to the speed of light in a vacuum Let ή = ή l / ή t

Computing T ή 2 sin 2 θ l = ή 2 (1- cos 2 θ l )= sin 2 θ t = 1-cos 2 θ t Solving for cos θ t Assuming normalized vectors cos θ t = T N = (1- ή 2 (1-cos 2 θ l )) 1/2 where cos θ l = L N T, N, and L must be coplanar T = α L + β N and T T = 1 Solving T = -1/ ή L (cos θ t - 1/ ή cos θ l ) N

Chromatic Dispersion The refraction coefficient is actually a function of wavelength η = η(λ) N L T r -N T g T b

Chromatic Dispersion with Shaders Easy to do with reflection maps Use three values of η Make use of vector operations