Sung-Eui Yoon ( 윤성의 )

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

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

Ray tracing. EECS 487 March 19,

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

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

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

Ray Tracing. Outline. Ray Tracing: History

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

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

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

CPSC GLOBAL ILLUMINATION

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

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

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

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

Ray Casting. Outline in Code. Outline. Finding Ray Direction. Heckbert s Business Card Ray Tracer. Foundations of Computer Graphics (Fall 2012)

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

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

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

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

CS-184: Computer Graphics. Administrative

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

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

Review for Ray-tracing Algorithm and Hardware

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

COMP371 COMPUTER GRAPHICS

Distributed Ray Tracing

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

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

Ray Casting. To Do. Outline. Outline in Code. Foundations of Computer Graphics (Spring 2012) Heckbert s Business Card Ray Tracer

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

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

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

Intro to Ray-Tracing & Ray-Surface Acceleration

Classic Rendering Pipeline

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

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

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 11: Ray tracing (cont.)

Photorealism: Ray Tracing

Supplement to Lecture 16

Shadows. COMP 575/770 Spring 2013

Computer Graphics Ray Casting. Matthias Teschner

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

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

Distribution Ray Tracing

Distribution Ray Tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

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

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

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

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

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

Physically Realistic Ray Tracing

EECS 487: Interactive Computer Graphics

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

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

Lighting and Shading

Raytracing CS148 AS3. Due :59pm PDT

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

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

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

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

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

The Traditional Graphics Pipeline

Lecture 10: Ray tracing

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

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

Computer Graphics. Bing-Yu Chen National Taiwan University

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity

Advanced Ray Tracing

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

Local vs. Global Illumination & Radiosity

Reading. 8. Distribution Ray Tracing. Required: Watt, sections 10.6,14.8. Further reading:

Acceleration Data Structures

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

The Traditional Graphics Pipeline

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

Accelerated Raytracing

Ray Tracing Part 2. CSC418/2504 Introduction to Computer Graphics. TA: Muhammed Anwar

Anti-aliasing and Monte Carlo Path Tracing

03 RENDERING PART TWO

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

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

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

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

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

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

Ray Intersection Acceleration

The Traditional Graphics Pipeline

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

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

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

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

Illumination Algorithms

Global Illumination The Game of Light Transport. Jian Huang

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Assignment 6: Ray Tracing

Ray Tracing. Kjetil Babington

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

Transcription:

CS380: Computer Graphics Ray Tracing Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/

Class Objectives Understand overall algorithm of recursive ray tracing Ray generations Intersection tests and acceleration methods Basic sampling methods Related chapter Part II, Ray Tracing 2

Various Visibility Algorithm Scan-line algorithm; briefly touched before Z-buffer Ray casting, etc. 3

Ray Casting For each pixel, find closest object along the ray and shade pixel accordingly Advantages Conceptually simple Can be extended to handle global illumination effects Disadvantages Renderer must have access to entire retained model Hard to map to special-purpose hardware Less efficient than rasterization in terms of utilizing spatial coherence 4

Recursive Ray Casting Ray casting generally dismissed early on because of aforementioned problems Gained popularity in when Turner Whitted (1980) showed this image Show recursive ray casting could be used for global illumination effects 5

Ray Casting and Ray Tracing Trace rays from eye into scene Backward ray tracing Ray casting used to compute visibility at the eye Perform ray tracing for arbitrary rays needed for shading Reflections Refraction and transparency Shadows 6

Basic Algorithms of Ray Tracing Rays are cast from the eye point through each pixel in the image From kavita s slides 7

Shadows Cast ray from the intersection point to each light source Shadow rays From kavita s slides 8

Reflections If object specular, cast secondary reflected rays From kavita s slides 9

Refractions If object tranparent, cast secondary refracted rays From kavita s slides 10

An Improved Illumination Model [Whitted 80] Phong model numlights j j j j j j n r = (kaia + k di d(n ˆ Lˆ j) + k si s(v ˆ R ˆ s ) ) j= 1 I Whitted model num_visible_lights j j j j Ir = (kaia + k di d(n ˆ Lˆ j)) + k ss + j= 1 k t T S and T are intensity of light from reflection and transmission rays Ks and Kt are specular and transmission coefficient 11

An Improved Illumination Model [Whitted 80] numlights j j j j Ir = (kaia + k di d(n ˆ Lˆ j)) + k ss + k j= 1 t T Computing reflection and transmitted/refracted rays is based on Snell s law 12

Ray Tree e f a s 2 s 0 s 1 eye c b d eye R T a s 0 b R T R T e s 2 f c s 1 b 13

Overall Algorithm of Ray Tracing Per each pixel, compute a ray, R Def function RayTracing (R) Compute an intersection against objects If no hit, Return the background color Otherwise, Compute shading, c General secondary ray, R Perform c = RayTracing (R ) Return c+c 14

Ray Representation We need to compute the first surface hit along a ray Represent ray with origin and direction Compute intersections of objects with ray Return the closest object p(t ) = o + td o d p 15

Generating Primary Rays o l d 16

Generating Secondary Rays The origin is the intersection point p 0 Direction depends on the type of ray Shadow rays use direction to the light source Reflection rays use incoming direction and normal to compute reflection direction Transparency/refraction use snell s law 17

Intersection Tests Go through all of the objects in the scene to determine the one closest to the origin of the ray (the eye). Strategy: Solve of the intersection of the Ray with a mathematical description of the object 18

Simple Strategy Parametric ray equation Gives all points along the ray as a function of the parameter p(t ) = o + td Implicit surface equation Describes all points on the surface as the zero set of a function f (p) = Substitute ray equation into surface function and solve for t 0 f (o + t d) = 0 19

Ray-Plane Intersection Implicit equation of a plane: Substitute ray equation: Solve for t: n p d= 0 n(o + td) d= 0 t(n d) = d n o d n o t = nd 20

Generalizing to Triangles Find of the point of intersection on the plane containing the triangle Determine if the point is inside the triangle Barycentric coordinate method Many other methods v 1 o v 3 p v 2 21

Barycentric Coordinates Points in a triangle have positive barycentric coordinates: p = α v + α + β + γ = 1 0 + βv1 γv2,where v 3 v 1 p v 2 v 2 p p p = v 0 + β ( v 1 v 0) + γ ( v 2 v 0) = ( 1 β γ ) v + βv + γv 0 1 2 v 0 v 1 22

Barycentric Coordinates Points in a triangle have positive barycentric coordinates: p = α v + α + β + γ = 1 0 + βv1 γv2,where v 3 v 1 p v 2 Benefits: Barycentric coordinates can be used for interpolating vertex parameters (e.g., normals, colors, texture coordinates, etc) 23

Ray-Triangle Intersection A point in a ray intersects with a triangle p ( t) = v 0 + β ( v 1 v 0) + γ ( v 2 v 0) v 3 v 1 p v 2 Three unknowns, but three equations Compute the point based on t Then, check whether the point is on the triangle 24

Pros and Cons of Ray Tracing Advantages of Ray Tracing: Very simple design Improved realism over the graphics pipeline Disadvantages: Very slow per pixel calculations Only approximates full global illumination Hard to accelerate with special-purpose H/W 25

Acceleration Methods Rendering time for a ray tracer depends on the number of ray intersection tests per pixel The number of pixels X the number of primitives in the scene Early efforts focused on accelerating the rayobject intersection tests More advanced methods required to make ray tracing practical Bounding volume hierarchies Spatial subdivision 26

Bounding Volumes Enclose complex objects within a simple-tointersect objects If the ray does not intersect the simple object then its contents can be ignored The likelihood that it will strike the object depends on how tightly the volume surrounds the object. 27 Potentially tighter fit, but with higher computation

Hierarchical Bounding Volumes Organize bounding volumes as a tree Each ray starts with the root BV of the tree and traverses down through the tree r 28

Spatial Subdivision Idea: Divide space in to subregions Place objects within a subregion into a list Only traverse the lists of subregions that the ray passes through Mailboxing used to avoid multiple test with objects in multiple regions Many types Regular grid Octree BSP tree kd-tree 29

30 Kd-tree: Example

31 Kd-tree: Example

32 Kd-tree: Example

33 Example

Kd-tree: Example What about triangles overlapping the split? 34

35 Kd-tree: Example

Other Optimizations Shadow cache Adaptive depth control Lazy geometry loading/creation 36

Distributed Ray Tracing [Cook et al. 84] Cook et al. realized that ray-tracing, when combined with randomized sampling, which they called jittering, could be adapted to address a wide range of rendering problems: 37

Soft Shadows Take many samples from area light source and take their average Computes fractional visibility leading to penumbra 38

Antialiasing The need to sample is problematic because sampling leads to aliasing Solution 1: super-sampling Increases sampling rate, but does not completely eliminate aliasing Difficult to completely eliminate aliasing without prefiltering because the world is not band-limited 39

Antialiasing Solution 2: distribute the samples randomly Converts the aliasing energy to noise which is less objectionable to the eye Instead of casting one ray per pixel, cast several sub- sampling. Instead of uniform subsampling, jitter the pixels slightly off the grid. 40

Jittering Results for Antialiasing 2x2 sub-sampling 41

Depth-of-Field Rays don t have to all originate from a single point. Real cameras collects rays over an aperture Can be modeled as a disk Final image is blurred away from the focal plane Gives rise to depth-of-field effects 42

Depth of Field image plane lens focal plane 43

Depth of Field Start with normal eye ray and find intersection with focal plane Choose jittered point on lens and trace line from lens point to focal point lens focal plane 44

Motion Blur Jitter samples through time Simulate the finite interval that a shutter is open on a real camera 45

46 Motion Blur

Complex Interreflection Model true reflection behavior as described by a full BRDF Randomly sample rays over the hemisphere, weight them by their BRDF value, and average them together This technique is called Monte Carlo Integration 47

Related Courses CS580: Advanced Computer Graphics Focus on rendering techniques that generate photo-realistic images CS482: Interactive Computer Graphics Interactive global illumination implemented by rasterization approaches Techniques used in recent games I ll teach it at Fall of 2018 48