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

Similar documents
Announcements. Written Assignment 2 out (due March 8) Computer Graphics

COMP371 COMPUTER GRAPHICS

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

Raytracing. COSC 4328/5327 Scott A. King

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

EECS 487: Interactive Computer Graphics

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

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

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

Distributed Ray Tracing

Distribution Ray Tracing

Photorealism: Ray Tracing

Reflection and Shading

Global Illumination. CSCI 420 Computer Graphics Lecture 18. BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch

Sung-Eui Yoon ( 윤성의 )

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

A Brief Overview of. Global Illumination. Thomas Larsson, Afshin Ameri Mälardalen University

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

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

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

Lighting and Shading

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

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

Distribution Ray-Tracing. Programação 3D Simulação e Jogos

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

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

Global Illumination. COMP 575/770 Spring 2013

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 457 Autumn 2017

Ray-Tracing. Misha Kazhdan

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

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

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

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

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

Raytracing & Epsilon. Today. Last Time? Forward Ray Tracing. Does Ray Tracing Simulate Physics? Local Illumination

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 557 Autumn 2017

Local vs. Global Illumination & Radiosity

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

Anti-aliasing and Monte Carlo Path Tracing

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

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

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

Specular reflection. Lighting II. Snell s Law. Refraction at boundary of media

Illumination Algorithms

CS 325 Computer Graphics

Light & Optical Systems Reflection & Refraction. Notes

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

Schedule. MIT Monte-Carlo Ray Tracing. Radiosity. Review of last week? Limitations of radiosity. Radiosity

Ray tracing. EECS 487 March 19,

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

CPSC GLOBAL ILLUMINATION

MIT Monte-Carlo Ray Tracing. MIT EECS 6.837, Cutler and Durand 1

Ray Optics. Ray model Reflection Refraction, total internal reflection Color dispersion Lenses Image formation Magnification Spherical mirrors

CS-184: Computer Graphics. Administrative

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

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Ray Tracing. Kjetil Babington

Lecture 18: Primer on Ray Tracing Techniques

Indirect Illumination

Reflection & refraction

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

Supplement to Lecture 16

Global Illumination The Game of Light Transport. Jian Huang

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

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Indirect Illumination

Photon Mapping. Due: 3/24/05, 11:59 PM

All forms of EM waves travel at the speed of light in a vacuum = 3.00 x 10 8 m/s This speed is constant in air as well

SAMPLING AND NOISE. Increasing the number of samples per pixel gives an anti-aliased image which better represents the actual scene.

The Rendering Equation. Computer Graphics CMU /15-662

Raytracing CS148 AS3. Due :59pm PDT

Recall: Basic Ray Tracer

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

Building a Fast Ray Tracer

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

At the interface between two materials, where light can be reflected or refracted. Within a material, where the light can be scattered or absorbed.

Chapter 5 Mirror and Lenses

Final Project: Real-Time Global Illumination with Radiance Regression Functions

Rendering Part I (Basics & Ray tracing) Lecture 25 December 1, 2015

Questions??? Announcements Assignment 3 due today

Reading. Distribution Ray Tracing. BRDF, revisited. Pixel anti-aliasing. ω in. Required: Shirley, section Further reading:

Chapter 32 Light: Reflection and Refraction. Copyright 2009 Pearson Education, Inc.

Ray Tracing. Last Time? Reading for Today. Reading for Today

Today s Topic: Refraction / Snell s Law

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

Chapter 5 Mirrors and Lenses

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

Ray Tracing: Special Topics CSCI 4239/5239 Advanced Computer Graphics Spring 2018

Science 8 Chapter 5 Section 1

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Monte-Carlo Ray Tracing. Antialiasing & integration. Global illumination. Why integration? Domains of integration. What else can we integrate?

Shading 1: basics Christian Miller CS Fall 2011

REFLECTION & REFRACTION

Topics and things to know about them:

Assignment 3: Path tracing

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

GEOMETRIC OPTICS. LENSES refract light, so we need to know how light bends when entering and exiting a lens and how that interaction forms an image.

Phys 102 Lecture 17 Introduction to ray optics

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

03 RENDERING PART TWO

Transcription:

Announcements Assignment 4 will be out later today Problem Set 3 is due today or tomorrow by 9am in my mail box (4 th floor NSH) How are the machines working out? I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster 1

Advanced Ray Tracing (Recursive) Ray Tracing Antialiasing Motion Blur Distribution Ray Tracing Other fancy stuff 11/11/02

Assumptions Simple shading (typified by OpenGL, z-buffering, and Phong illumination model) assumes: direct illumination (light leaves source, bounces at most once, enters eye) no shadows opaque surfaces point light sources sometimes fog (Recursive) ray tracing relaxes that, simulating: specular reflection shadows transparent surfaces (transmission with refraction) sometimes indirect illumination (a.k.a. global illumination) sometimes area light sources sometimes fog 3

Ray Types for Ray Tracing We ll distinguish four ray types: Eye rays: originate at the eye Shadow rays: from surface point toward light source Reflection rays: from surface point in mirror direction Transmission rays: from surface point in refracted direction 4

Ray Tracing Algorithm send ray from eye through each pixel compute point of closest intersection with a scene surface shade that point by computing shadow rays spawn reflected and refracted rays, repeat 5

Specular Reflection Rays Reflected Ray N P Eye A Shiny Surface Note: arrowheads show the direction in which we're tracing the rays, not the direction the light travels. An eye ray hits a shiny surface We know the direction from which a specular reflection would come, based on the surface normal Fire a ray in this reflected direction The reflected ray is treated just like an eye ray: it hits surfaces and spawns new rays Light flows in the direction opposite to the rays (towards the eye), is used to calculate shading It s easy to calculate the reflected ray direction 6

Specular Transmission Rays To add transparency: Add a term for light that s coming from within the object These rays are refracted (bent) when passing through a boundary between two media with different refractive indices When a ray hits a transparent surface fire a transmission ray into the object at the proper refracted angle If the ray passes through the other side of the object then it bends again (the other way) 7

Refraction Refraction: The bending of light due to its different velocities through different materials rays bend toward the normal when going from sparser to denser materials (e.g. air to water), away from normal in opposite case Refractive index: Light travels at speed c/n in a material of refractive index n» c is the speed of light in a vacuum» c varies with wavelength, hence rainbows and prisms Use Snell s law n 1 sin θ 1 =n 2 sin θ 2 to derive refracted ray direction MATERIAL INDEX OF REFRACTION air/vacuum 1 water 1.33 glass about 1.5 diamond 2.4 n 1 n 2 n θ 2 θ 1 8

Refraction Demo program http://micro.magnet.fsu.edu/primer/java/refraction/index.html http://stwww.weizmann.ac.il/lasers/laserweb/java/twoangles2.htm 9

EYE Ray Genealogy Obj3 Eye L1 L2 Obj1 Obj1 Obj2 RAY PATHS (BACKWARD) RAY TREE 10

EYE Ray Genealogy Obj3 L1 Eye L1 Obj1 L2 L2 Obj2 T Obj1 R Obj3 Obj2 RAY PATHS (BACKWARD) RAY TREE 11

EYE Ray Genealogy Obj3 L1 Eye L1 Obj1 L2 L1 L2 L2 Obj2 R T Obj1 R Obj3 T R L1 L2 Obj2 RAY PATHS (BACKWARD) X X RAY TREE X 12

EYE Obj3 When to stop? When a ray leaves the scene L1 Obj1 Obj2 L2 When its contribution becomes small at each step the contribution is attenuated by the K s in the illumination model. I = k a I a + f att I light [ ] k cosθ + k (cosφ ) d s n shiny 13

Ray Casting vs. Ray Tracing Ray Casting -- 1 bounce Ray Tracing -- 2 bounce Ray Tracing -- 3 bounce 14

Writing a Simple Ray Tracer Raytrace() // top level function for each pixel x,y color(pixel) = Trace(ray_through_pixel(x,y)) Trace(ray) // fire a ray, return RGB radiance object_point = closest_intersection(ray) if object_point return Shade(object_point, ray) else return Background_Color 15

Writing a Simple Ray Tracer (Cont.) Shade(point, ray) /* return radiance along ray */ radiance = black; /* initialize color vector */ for each light source shadow_ray = calc_shadow_ray(point,light) if!in_shadow(shadow_ray,light) radiance += phong_illumination(point,ray,light) if material is specularly reflective radiance += spec_reflectance * Trace(reflected_ray(point,ray))) if material is specularly transmissive radiance += spec_transmittance * Trace(refracted_ray(point,ray))) return radiance Closest_intersection(ray) for each surface in scene calc_intersection(ray,surface) return the closest point of intersection to viewer (also return other info about that point, e.g., surface normal, material properties, etc.) 16

Problem with Simple Ray Tracing: Aliasing 17

Aliasing Ray tracing gives a color for every possible point in the image But a square pixel contains an infinite number of points These points may not all have the same color Sampling: choose the color of one point (center of pixel) This leads to aliasing» jaggies» moire patterns aliasing means one frequency (high) masquerading as another (low)» e.g. wagon wheel effect How do we fix this problem? 18

Antialiasing Supersampling Fire more than one ray for each pixel (e.g., a 3x3 grid of rays) Average the results using a filter 19

Antialiasing Supersampling Can be done adaptively divide pixel into 2x2 grid, trace 5 rays (4 at corners, 1 at center) if the colors are similar then just use their average otherwise recursively subdivide each cell of grid keep going until each 2x2 grid is close to uniform or limit is reached filter the result 20

Adaptive Supersampling: Making the World a Better Place Is adaptive supersampling the answer? Areas with fairly constant appearance are sparsely sampled (good) Areas with lots of variability are heavily sampled (good) But alas... even with massive supersampling visible aliasing is possible when the sampling grid interacts with regular structures problem is, objects tend to be almost aligned with sampling grid noticeable beating, moire patterns, etc are possible So use stochastic sampling instead of a regular grid, subsample randomly (or pseudo) adaptively sample statistically keep taking samples until the color estimates converge jittering: perturb a regular grid 21

Supersampling 22

Temporal Aliasing Aliasing happens in time as well as space the sampling rate is the frame rate, 30Hz for NTSC video, 24Hz for film fast moving objects move large distances between frames if we point-sample time, objects have a jerky, strobed look To avoid temporal aliasing we need to filter in time too so compute frames at 120Hz and average them together (with appropriate weights)? fast-moving objects become blurred streaks Real media (film and video) automatically do temporal antialiasing photographic film integrates over the exposure time video cameras have persistence (memory) this shows up as motion blur in the photographs 23

Motion Blur Apply stochastic sampling to time as well as space Assignatimeaswellasanimagepositiontoeachray The result is still-frame motion blur and smooth animation This is an example of distribution ray tracing 24

The Classic Example of Motion Blur From Foley et al. Plate III.16 Rendered using distribution ray tracing at 4096x3550 pixels, 16 samples per pixel. Note motion-blurred reflections and shadows with penumbrae cast by extended light sources. 25

Distribution Ray Tracing distribute rays throughout a pixel to get spatial antialiasing distribute rays in time to get temporal antialiasing (motion blur) distribute rays in reflected ray direction to simulate gloss distribute rays across area light source to simulate penumbras (soft shadows) distribute rays across hemisphere to simulate diffuse interreflection a.k.a. distributed ray tracing or stochastic ray tracing a form of numerical integration aliasing is replaced by less visually annoying noise! powerful idea! (but can get slow) 26

Gloss and Highlights Simple ray tracing spawns only one reflected ray But Phong illumination models a cone of rays Produces fuzzy highlights Change fuzziness (cone width) by varying the shininess parameter Can we generate fuzzy highlights? Yes But there s a catch» we can t do light reflected from the fuzzy highlight onto other objects A more accurate model is possible using stochastic sampling Stochastically sample rays within the cone Sampling probability drops off sharply away from the specular angle Highlights can be soft, blurred reflections of other objects 27

Soft Shadows Point light sources produce sharp shadow edges the point is either shadowed or not only one ray is required With an extended light source the surface point may be partially visibletoit(partial eclipse) only part of the light from the sources reaches the point the shadow edges are softer the transition region is the penumbra Distribution ray tracing can simulate this: fire shadow rays from random points on the source weight them by the brightness the resulting shading depends on the fraction of the obstructed shadow rays shadow rays source surface opaque object 28

Soft Shadows source shadow rays opaque object surface fewer rays, more noise more rays, less noise 29

Depth of Field The pinhole camera model only approximates real optics real cameras have lenses with focal lengths only one plane is truly in focus points away from the focus project as disks the further away from the focus the larger the disk the range of distance that appear in focus is the depth of field simulate this using stochastic sampling through different parts of the lens Lens Image Surface 30

Examples Including texture map and bump map http://www.graphics.cornell.edu/online/tutorial/raytrace/ 31

Examples Semi-transparent glass with etched image. http://www.graphics.cornell.edu/online/tutorial/raytrace/ 32

Beyond Ray Tracing Ray tracing ignores the diffuse component of incident illumination to achieve this component requires sending out rays from each surface point for the whole visible hemisphere thisisthebranching factor of the recursive ray tree Even if you could compute such a massive problem there is a conceptual problem: you will create loops:» point A gets light from point B» point B also gets light from point A 33

Doing it Really Right (or trying) The real solution is to solve simultaneously for incoming and outgoing light at all surface points this is a massive integral equation Radiosity deals with the easy case of purely diffuse scenes Or, you can sample many, many complete paths from light source to camera Metropolis Light Transport (Veach and Guibas, Siggraph 1997) 34

Diffuse Illumination From Veach and Guibas, Siggraph 97 35

Caustics From Veach and Guibas, Siggraph 97 36

Announcements Assignment 4 will be out later today Problem Set 3 is due today or tomorrow by 9am in my mail box (4 th floor NSH) How are the machines working out? I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster 37