TIEA311 Tietokonegrafiikan perusteet kevät 2018

Similar documents
TIEA311 Tietokonegrafiikan perusteet kevät 2018

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

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

TIEA311 Tietokonegrafiikan perusteet kevät 2017

Intro to Ray-Tracing & Ray-Surface Acceleration

TIEA311 Tietokonegrafiikan perusteet kevät 2018

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

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

Review. Stephen J. Guy

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

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

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

Sung-Eui Yoon ( 윤성의 )

Lecture 10: Ray tracing

Ray Tracing. CPSC 453 Fall 2018 Sonny Chan

Pipeline Operations. CS 4620 Lecture 10

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

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

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

Ray Tracing. Brian Curless CSEP 557 Fall 2016

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

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

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

Photorealism: Ray Tracing

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

Pipeline Operations. CS 4620 Lecture 14

Chapter 7 - Light, Materials, Appearance

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

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

Ray tracing. EECS 487 March 19,

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

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

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

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

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

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

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

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

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

Global Illumination CS334. 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.

MIT Ray Tracing Ray Tracing

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

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

Global Illumination and Monte Carlo

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Lecture 18: Primer on Ray Tracing Techniques

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

03 RENDERING PART TWO

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

CHAPTER 1 Graphics Systems and Models 3

Texture Mapping. Michael Kazhdan ( /467) HB Ch. 14.8,14.9 FvDFH Ch. 16.3, , 16.6

Shading, Advanced Rendering. Week 7, Wed Feb 28

Real-Time Shadows. Computer Graphics. MIT EECS Durand 1

Shadows. COMP 575/770 Spring 2013

Ray-Tracing. Misha Kazhdan

Assignment 2 Ray Tracing

CPSC GLOBAL ILLUMINATION

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

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

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

Raytracing CS148 AS3. Due :59pm PDT

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

Overview: Ray Tracing & The Perspective Projection Pipeline

Movie: For The Birds. Announcements. Ray Tracing 1. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

Supplement to Lecture 16

CS452/552; EE465/505. Intro to Lighting

CS-184: Computer Graphics. Administrative

Topics and things to know about them:

Computer Graphics and Image Processing Ray Tracing I

Graphics Hardware and Display Devices

A Little Background. Motivation. Motivation

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

Photon Mapping. Michael Doggett Department of Computer Science Lund university

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

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

Course Title: Computer Graphics Course no: CSC209

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

Photorealistic 3D Rendering for VW in Mobile Devices

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

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

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Perspective projection. A. Mantegna, Martyrdom of St. Christopher, c. 1450

Computer Graphics Global Illumination

Review for Ray-tracing Algorithm and Hardware

COMP371 COMPUTER GRAPHICS

782 Schedule & Notes

CS 325 Computer Graphics

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

Monte Carlo Ray Tracing. Computer Graphics CMU /15-662

COMPLETION OF Z-buffer Graphics Pipeline

Graphics and Interaction Rendering pipeline & object modelling

Illumination Algorithms

Luxo Jr. Plan. Team. Movies. Why Computer Graphics? Introduction to Computer Graphics. Pixar Animation Studios, 1986 Director: John Lasseter

Ray Tracing. Kjetil Babington

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

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

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

Transcription:

TIEA311 Tietokonegrafiikan perusteet kevät 2018 ( Principles of Computer Graphics Spring 2018) Copyright and Fair Use Notice: The lecture videos of this course are made available for registered students only. Please, do not redistribute them for other purposes. Use of auxiliary copyrighted material (academic papers, industrial standards, web pages, videos, and other materials) as a part of this lecture is intended to happen under academic fair use to illustrate key points of the subject matter. The lecturer may be contacted for take-down requests or other copyright concerns (email: paavo.j.nieminen@jyu.fi).

TIEA311 Tietokonegrafiikan perusteet kevät 2018 ( Principles of Computer Graphics Spring 2018) Adapted from: Wojciech Matusik, and Frédo Durand: 6.837 Computer Graphics. Fall 2012. Massachusetts Institute of Technology: MIT OpenCourseWare, https://ocw.mit.edu/. License: Creative Commons BY-NC-SA Original license terms apply. Re-arrangement and new content copyright 2017-2018 by Paavo Nieminen and Jarno Kansanaho Frontpage of the local course version, held during Spring 2018 at the Faculty of Information technology, University of Jyväskylä: http://users.jyu.fi/ nieminen/tgp18/

TIEA311 - Today in Jyväskylä (in Finnish) The steps of Jarno (Ajattelumallia tehtävien ratkaisuun): 1. Luentomateriaali 2. Tehtävänanto (muista mitä aiemmissa tehtävissä on tehty/annettu) 3. Hae lähdekoodi ja testaa sen toiminta 4. Yhdistä teoria tehtävään ja lähdekoodiin, ymmärrä kokonaisuus 5. Hahmottele kevyt speksi esim. paperille UML, prosessikaavio,... - 6. Tee osatehtävä 1 7. Päivitä speksi 8. Tee osatehtävä 2 9. Päivitä speksi...

MIT EECS 6.837 Computer Graphics Part 2 Rendering Today: Intro to Rendering, Ray Casting NVIDIA NVIDIA Inc. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. MIT EECS 6.837 Matusik 1

The Story So Far Modeling splines, hierarchies, transformations, meshes, etc. Animation skinning, ODEs, masses and springs Now we ll to see how to generate an image given a scene description! 4

TIEA311 - Rest of the Course in Jyväskylä The next slide is verbatim from the MIT OCW course. Here is the current plan for the remaining part of our adapted short version: Ray Casting: cover fully. Ray Tracing: cover the basic idea, skip details possible to continue as a hobby project ; NOTE: teachers of TIEA306 Ohjelmointityö may be contacted regarding the possibility of receiving credit for hobby projects. Shading, texture mapping: Cover the principles up to Phong model and texture coordinates. Rasterization, z-buffering: cover basic ideas Global Illumination, Monte Carlo techniques: skip this could be suitable for bachelor thesis (introductory topics) or even master thesis (current state-of-the-art techniques) Image-based rendering: skip defer to advanced courses (e.g. TIES411 Konenäkö ja kuva-analyysi ) Sampling and antialiasing: mostly skip defer theory to TIES324 Signaalinkäsittely and techniques (possibly) to TIES471 Reaaliaikainen renderöinti. Shadow techniques, Graphics Hardware defer to TIES471.

The Remainder of the Term Ray Casting and Ray Tracing Intro to Global Illumination Monte Carlo techniques, photon mapping, etc. Shading, texture mapping What makes materials look like they do? Image-based Rendering Sampling and antialiasing Rasterization, z-buffering Shadow techniques Graphics Hardware [Lehtinen et al. 2008] ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 5

Today What does rendering mean? Basics of ray casting 6

source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Scene Oscar Meruvia-Pastor, Daniel Rypl. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 7

source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Oscar Meruvia-Pastor, Daniel Rypl. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Scene This image is in the public domain. Source: openclipart Camera 8

source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. This image is in the public domain. Source: openclipart Oscar Meruvia-Pastor, Daniel Rypl. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Scene Pixels Image plane Camera 9

Rendering = Scene to Image source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Image Oscar Meruvia-Pastor, Daniel Rypl. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Scene Pixels Image plane This image is in the public domain. Source: openclipart Camera 10

Rendering Pinhole Camera source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Image This image is in the public domain. Source: openclipart Oscar Meruvia-Pastor, Daniel Rypl. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Scene Pixels Each pixel corresponds to one ray. We need to figure out which scene point each one hits. 11

Rendering source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Image Oscar Meruvia-Pastor, Daniel Rypl. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Scene Pixels This image is in the public domain. Source: openclipart What s the color you put in each pixel? 12

Rendering source unknown. All rights reserved. This ontent is excluded from our Creative ommons license. For more information, ee http://ocw.mit.edu/help/faq-fair-use/. Image Oscar Meruvia-Pastor, Daniel Rypl. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Scene Pixels This image is in the public domain. Source: openclipart Pixel Color Determined by Lighting/Shading 13

Rendering Rendering refers to the entire process that produces color values for pixels, given a 3D representation of the scene Pixels correspond to rays; need to figure out the visible scene point along each ray Called hidden surface problem in older texts Visibility is a more modern term Also, we assume (for now) a single ray per pixel 14

Rendering Rendering refers to the entire process that produces color values for pixels Pixels correspond to rays; need to figure out the visible scene point along each ray Called hidden surface problem in older texts Visibility is a more modern term Also, we assume (for now) a single ray per pixel Major algorithms: Ray casting and rasterization Note: We are assuming a pinhole camera (for now) 15

Questions? 16

Ray Casting Ray Casting Basics Camera and Ray Generation Ray-Plane Intersection Ray-Sphere Intersection 17

Ray Casting For every pixel Construct a ray from the eye For every object in the scene Find intersection with the ray Keep if closest 18

Shading For every pixel Construct a ray from the eye For every object in the scene Find intersection with the ray Keep if closest Shade 19

Shading = What Surfaces Look Like Surface/Scene Properties surface normal direction to light L N V viewpoint Material Properties Diffuse (matte) Specular (shiny) Light properties Position Intensity,... Much more! Diffuse sphere Specular spheres 20

Ray Casting vs. Ray Tracing Let s think about shadows... This image is in the public domain. Source: openclipart 21

Ray Casting vs. Ray Tracing? camera rays are rays from the camera to the scene This image is in the public domain. Source: openclipart 22

Ray Casting vs. Ray Tracing X ray from light to hit point is blocked, i.e., point is in shadow This image is in the public domain. Source: openclipart 23

Ray Casting vs. Ray Tracing Ray casting = eye rays only, tracing = also secondary X Secondary rays are used for testing shadows, doing reflections, refractions, etc. This image is in the public domain. Source: openclipart We ll do all this a little later! 24

Secondary Rays Indirect illumination Reflections Refractions Henrik Wann Jensen Shadows Caustics Courtesy of Henrik Wann Jensen. Used with permission. 25

Ray Tracing Reflections Courtesy of Henrik Wann Jensen. Used with permission. Reflections, refractions Turner Whitted, Bell Laboratories. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Caustics source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 26

Questions? 27

Ray Casting For every pixel Construct a ray from the eye For every object in the scene Find intersection with the ray Keep if closest Shade depending on light and normal vector N Finding the intersection point and normal is the central part of ray casting 28

Ray Representation Origin Point Direction Vector normalized is better Parametric line P(t) = origin + t * direction How would you represent a ray? P(t) direction origin 29

Ray Representation Origin Point Direction Vector normalized is better Parametric line P(t) = origin + t * direction Another way to put the ray casting problem statement: Find smallest t > 0 such that P(t) lies on a surface in the scene P(t) direction origin 30

Dürer s Ray Casting Machine Albrecht Dürer, 16 th century source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 31

Dürer s Ray Casting Machine Albrecht Dürer, 16 th century source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 32

Ray Casting Ray Casting Basics Camera and Ray Generation Ray-Plane Intersection Ray-Sphere Intersection 33

34 Cameras For every pixel Construct a ray from the eye For every object in the scene Find intersection with ray Keep if closest source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/.

Pinhole Camera Box with a tiny hole Inverted image Similar triangles Perfect image if hole infinitely small Pure geometric optics No depth of field issue (everything in focus) 35

Oldest Illustration From Gemma Frisius, 1545 source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 36

Also Called Camera Obscura Image courtesy of Wellcome Library, London. License: CC-BY-NC. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 37

Camera Obscura Today Images removed due to copyright restrictions -- please see http://www.abelardomorell.net/photography/cameraobsc_01/cameraobsc_17.html http://www.abelardomorell.net/posts/camera-obscura/ http://www.abelardomorell.net/photography/cameraobsc_49/cameraobsc_63.html for further details. Abelardo Morell www.abelardomorell.net 38

Camera Obscura Today Images removed due to copyright restrictions -- please see http://www.abelardomorell.net/photography/cameraobsc_01/cameraobsc_17.html http://www.abelardomorell.net/posts/camera-obscura/ http://www.abelardomorell.net/photography/cameraobsc_49/cameraobsc_63.html for further details. Abelardo Morell www.abelardomorell.net 38

Simplified Pinhole Camera Eye-image pyramid (view frustum) Note that the distance/size of image are arbitrary same image will result on this image plane 39

Camera Description? 40

Camera Description? Eye point e (center) Orthobasis u, v, w (horizontal, up, direction) v Object coordinates World coordinates View coordinates Image coordinates u w 41

Camera Description? Eye point e (center) Orthobasis u, v, w (horizontal, up, direction) Field of view angle Image rectangle aspect ratio Object coordinates World coordinates View coordinates Image coordinates u v w 42

Image Coordinates -1 y 1 Convenient to define normalized image coordinates such that the x, y coordinates run from -1 to 1 regardless of the dimensions and aspect ratio of the image rectangle. -1 x 1 Image plane This image is in the public domain. Source: openclipart Camera 43

Ray Generation in 2D image plane -1 < x < 1 x p p is point on image plane at coordinate x, we want to know the direction of the ray r r? view direction w field of view α eye point e right u This image is in the public domain. Source: openclipart 44

Ray Generation in 2D image plane -1 < x < 1 1 What is the distance D to the screen so that the normalized coordinates go to 1? view direction w field of view α right u This image is in the public domain. Source: openclipart 45

Corrections CORRECTION: In the following few slides, the ideas are brilliantly visualized, but some of the equations are rubbish. These are OK: tan(α/2) = 1/D D = 1/ tan(α/2) The others should read as: r = p e = xu + Dw And (for the 3D case): r = xu + aspect yv + Dw

Ray Generation in 2D image plane -1 < x < 1 1 D view direction w field of view α right u This image is in the public domain. Source: openclipart 46

Ray Generation in 2D r = p-e = (x*u, D*w) image plane -1 < x < 1 D x r p view direction w field of view α eye point e right u This image is in the public domain. Source: openclipart 47

Ray Generation in 2D image plane -1 < x < 1 r = p-e = (x*u, D*w) D x r p then we just normalize r to get the ray view direction w field of view α eye point e right u This image is in the public domain. Source: openclipart 48

That was 2D, 3D is just as simple y coordinate is treated just like x, except accounting for aspect ratio r = (x*u, aspect*y*v, D*w) Again, u, v, w are the basis vectors of the view coordinate system Aspect ratio handles non-square viewports Think of your 16:9 widescreen TV The point of the exercise with computing D was to allow us to use the [-1,1] image coordinate system regardless of field of view. 49

Perspective vs. Orthographic perspective orthographic Parallel projection No foreshortening No vanishing point 50

Orthographic Camera Ray Generation? Origin = e + x*size*u + y*size*v Direction is constant: w 51

Other Weird Cameras E.g. fish eye, omnimax, parabolic CAVE Columbia University CAVE Lab, Columbia University. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 52

Questions? Even Funkier Multiperspective Imaging Courtesy of Paul Rademacher. Used with permission. 53