CS 148, Summer 2012 Introduction to Computer Graphics and Imaging Justin Solomon

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

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

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

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

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

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

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

Ray tracing. EECS 487 March 19,

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

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

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

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

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

Lecture 18: Primer on Ray Tracing Techniques

Global Illumination. COMP 575/770 Spring 2013

Acceleration Data Structures

Ray tracing idea. Ray Tracing. Ray tracing algorithm. Plane projection in drawing. CS 465 Lecture 3

Sung-Eui Yoon ( 윤성의 )

CPSC GLOBAL ILLUMINATION

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

Advanced Ray Tracing

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

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

CS Computer Graphics: Introduction to Ray Tracing

CS Computer Graphics: Introduction to Ray Tracing

Raytracing CS148 AS3. Due :59pm PDT

Distribution Ray Tracing

Ray Tracing Part 1. CSC418/2504 Introduction to Computer Graphics. TA: Muhammed Anwar & Kevin Gibson

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

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

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

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

Distributed Ray Tracing

Ray-tracing Acceleration. Acceleration Data Structures for Ray Tracing. Shadows. Shadows & Light Sources. Antialiasing Supersampling.

CS 4204 Computer Graphics

The Traditional Graphics Pipeline

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

CS 464 Review. Review of Computer Graphics for Final Exam

Anti-aliasing. Images and Aliasing

Lecture 11: Ray tracing (cont.)

Ray Tracing. Kjetil Babington

VIII. Visibility algorithms (II)

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

Review for Ray-tracing Algorithm and Hardware

Shadows. COMP 575/770 Spring 2013

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

Real-Time Ray Tracing Using Nvidia Optix Holger Ludvigsen & Anne C. Elster 2010

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

Accelerating Ray Tracing

Photorealism: Ray Tracing

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

03 RENDERING PART TWO

Ray Tracing. CPSC 453 Fall 2018 Sonny Chan

Intersection Acceleration

The Traditional Graphics Pipeline

Questions from Last Week? Extra rays needed for these effects. Shadows Motivation

CS 431/636 Advanced Rendering Techniques

The Rendering Equation and Path Tracing

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

Advanced Graphics. Path Tracing and Photon Mapping Part 2. Path Tracing and Photon Mapping

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

Accelerated Raytracing

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

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

CPSC / Sonny Chan - University of Calgary. Collision Detection II

Ray Tracing COMP575/COMP770

The Traditional Graphics Pipeline

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Acceleration. Welcome!

Logistics. CS 586/480 Computer Graphics II. Questions from Last Week? Slide Credits

Recursion and Data Structures in Computer Graphics. Ray Tracing

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

Intro to Ray-Tracing & Ray-Surface Acceleration

Accelerating Ray-Tracing

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

Computer Graphics Shadow Algorithms

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

CS-184: Computer Graphics. Administrative

CS 354R: Computer Game Technology

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

EECS 487: Interactive Computer Graphics

COMP 175: Computer Graphics April 11, 2018

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

The exam begins at 2:40pm and ends at 4:00pm. You must turn your exam in when time is announced or risk not having it accepted.

קורס גרפיקה ממוחשבת 2010/2009 סמסטר א' Rendering 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור

Interactive Methods in Scientific Visualization

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule

Raytracing. COSC 4328/5327 Scott A. King

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

The University of Calgary

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

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

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

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

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

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

Local vs. Global Illumination & Radiosity

COMP371 COMPUTER GRAPHICS

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

Lecture 2 - Acceleration Structures

Transcription:

http://www.futuretech.blinkenlights.nl/misc/scene_1024x768.jpg CS 148, Summer 2012 Introduction to Computer Graphics and Imaging Justin Solomon

http://www.publicdomainpictures.net/view-image.php?picture=female-photographer&image=4360&large=1 http://bloodredpencil.blogspot.com/2010/09/need-help-get-help.html

http://www.publicdomainpictures.net/view-image.php?picture=female-photographer&image=4360&large=1 http://bloodredpencil.blogspot.com/2010/09/need-help-get-help.html

http://software.intel.com/file/37491

Light source http://software.intel.com/file/37491

Light interacts with objects in scene http://software.intel.com/file/37491

Image plane http://software.intel.com/file/37491

?? http://software.intel.com/file/37491 Most light doesn t reach the camera

?? http://software.intel.com/file/37491 Most light doesn t reach the camera

Many lighting effects are reversible

Trace rays from light to camera

Trace rays from light to camera

Draw viewing ray through each pixel

Intersect with geometry

Compute light ray

Evaluate shading µ

Take closest one

µ µ Redirect ray

µ µ Redirect ray

Rasterization for (each object in scene) drawobject();

Rasterization for (each object in scene) drawobject(); Ray Tracing for (each pixel in image) sendray();

Rasterization for (each object in scene) drawobject(); Ray Tracing for (each pixel in image) sendray();

for each pixel do compute viewing ray if (ray hits an object with t>0) then Compute normal Evaluate shading model else Set pixel color to background color Textbook page 85

~d = direction ~o = origin Ray

~d = direction Does not have to be unit length! ~o = origin Ray

t 1 t 2 (0; 1) ~o + t ~ d Point on Ray

~o + t ~ d t < 0 Point on Ray

~o + t ~ d t < 0 Point on Ray

No perspective transformation needed! ~j ~p 0 ~p = ~p 0 + u~i + v~j u 2 [0; w]; v 2 [0; h] ~i Generating rays

k~x ~ck 2 = R 2 ~o + t ~ d Ray-object intersection

~o + t ~ d k~x ~ck 2 = R 2 Ray-object intersection

~o + t ~ d k~x ~ck 2 = R 2 k~o + t ~ d ~ck 2 = R 2 Ray-object intersection

~o + t ~ d k~x ~ck 2 = R 2 k~o + t ~ d ~ck 2 = R 2 (~o + t ~ d ~c) (~o + t ~ d ~c) = R 2 Ray-object intersection

~o + t d ~ k~x ~ck 2 = R 2 k~o + t d ~ ~ck 2 = R 2 (~o + t d ~ ~c) (~o + t d ~ ~c) = R 2 k dk ~ 2 t 2 + 2((~o ~c) d)t ~ + k~o ~ck 2 = R 2 Ray-object intersection

Ray-object intersection CS 148, fall 2011

~x ~c ~ N = ~x ~c k k Normals

~v 3 ~N = (~v 2 ~v 1 ) (~v 3 ~v 1 ) k(~v 2 ~v 1 ) (~v 3 ~v 1 )k ~v 3 ~v 1 ~v 1 ~v 2 ~v 2 ~v 1 http://designjk.files.wordpress.com/2011/12/teapot-decorated.png Normals

~ l2 ~x ~ l1 ~x ~x Light rays

http://www.spot3d.com/vray/help/150sp1/images/examples/shadows/03_raytraced_colored.png

http://2.bp.blogspot.com/-2cpxosdtne8/t5nmclgobpi/aaaaaaaaaj4/xgaz168hpkg/s1600/p0008_i004.png Intersect light ray with scene

abstract class surface virtual hit-record hit(ray, t0, t1) virtual box bounding-box() struct hit-record vector3d position, normal surface hit-surface abstract class material color evaluate(in-ray, normal, pos)

color ray-trace(ray r) hit-record record = intersect(r); if (record.hit-surface.is-reflective) ray reflected-ray = reflect(r,record.normal); color reflected-color = ray-trace(reflected-ray); compute-spectral-component( reflected-color);

Lots of bounces Fewer bounces CS 148, fall 2011 Save time; avoid infinite recursion

http://www.deepakantony.com/wp-content/uploads/2012/04/ambientocclusion_instancing.png http://members.optusnet.com.au/pennywyatt/images/people.png Deal with repeated objects

Store object once, use often http://members.optusnet.com.au/pennywyatt/images/people.png Deal with repeated objects

Each instance stores a transformation matrix M (can stretch, rotate, etc!) Deal with repeated objects

M 2 R 3 3 Object coordinates World coordinates Deal with repeated objects

M 2 R 3 3 ~o + t ~ d Deal with repeated objects

Do intersection here! M 2 R 3 3 M 1 ~o + tm 1 ~ d ~o + t ~ d Deal with repeated objects

M 2 R 3 3 M 1 ~o + tm 1 ~ d Same t! ~o + t ~ d Deal with repeated objects

M 2 R 3 3 ~N ~ M ~ N Deal with repeated objects

http://upload.wikimedia.org/wikipedia/commons/8/8b/csg_tree.png Binary operations for shape

A B A [ B A B A \ B http://en.wikipedia.org/wiki/constructive_solid_geometry Binary operations for shape

A B A [ B A B A \ B http://en.wikipedia.org/wiki/constructive_solid_geometry Binary operations for shape

A B in(a) = [1; 3] in(b) = [2; 6] in(a \ B) = [2; 3] in(a [ B) = [1; 6] in(a B) = [1; 2) Store inside intervals

A B in(a) = [1; 3] in(b) = [2; 6] in(a \ B) = [2; 3] in(a [ B) = [1; 6] in(a B) = [1; 2) Store inside intervals

A B in(a) = [1; 3] in(b) = [2; 6] in(a \ B) = [2; 3] in(a [ B) = [1; 6] in(a B) = [1; 2) Store inside intervals

A B in(a) = [1; 3] in(b) = [2; 6] in(a \ B) = [2; 3] in(a [ B) = [1; 6] in(a B) = [1; 2) Store inside intervals

http://ps-2.kev009.com/catia-b18/basug_c2/basugbt1510.htm

http://www.hackification.com/2008/08/31/experiments-in-ray-tracing-part-8-anti-aliasing/

Scatter rays to make ray tracing less crisp.

Multiple rays per pixel

Moiré pattern http://upload.wikimedia.org/wikipedia/commons/f/fb/moire_pattern_of_bricks_small.jpg Multiple rays per pixel

Remove Moiré patterns http://en.wikipedia.org/wiki/file:moire_pattern_of_bricks.jpg

???

Hard shadows Soft shadows http://erich.realtimerendering.com/shadow_comparison.html

http://user.online.be/felixverbelen/lunecl.jpg Lights aren t all point sources

Randomly sample light rays

Shadow computed per ray

Shadow computed per ray

Shadow computed per ray

http://liam887.files.wordpress.com/2010/08/weaver.jpg

Square lens Focus plane Randomly sample eye positions

https://graphics.stanford.edu/wikis/cs148-11-fall/raytracingresults http://www.baylee-online.net/projects/raytracing/algorithms/glossy-reflection-transmission Randomly sample reflected rays

http://www.matkovic.com/anto/3dl-test-balls-01.jpg Randomly sample positions

Diffuse Ambient http://en.wikipedia.org/wiki/ambient_occlusion Brightness depends on nearby geometry

Account for indirect lighting http://en.wikipedia.org/wiki/global_illumination

Diffuse inter-reflection Account for indirect lighting http://en.wikipedia.org/wiki/global_illumination

Caustics Account for indirect lighting http://en.wikipedia.org/wiki/global_illumination

Value p b m Variable Pixels on screen Objects in scene Average pixels/object Rasterization: O(bm) Ray tracing: O(bp) Accelerated ray tracing: O(p log b) CS 148, fall 2011

http://sopra.le-gousteau.de/images/2/2e/bv_bvh_bspheres.jpg http://graphics.ucsd.edu/courses/rendering/2004/ssaha/index_files/finalbvh.jfif Bounding Volume Hierarchy (BVH)

http://algorithmicarts.com/images/2008/bsptree-cutaway1269x684.png Binary Space Partitioning (BSP) trees

Uniform subdivision grid http://www.cs.berkeley.edu/~sequin/cs184/imgs/spatialsubdiv.gif

[NVIDIA, SIGGRAPH 2008] Embarrassingly parallel, but not SIMD?

http://www.futuretech.blinkenlights.nl/misc/scene_1024x768.jpg CS 148, Summer 2012 Introduction to Computer Graphics and Imaging Justin Solomon