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

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

Sung-Eui Yoon ( 윤성의 )

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

CS-184: Computer Graphics. Administrative

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

Ray tracing. EECS 487 March 19,

EECS 487: Interactive Computer Graphics

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

Shadows. COMP 575/770 Spring 2013

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

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

Intro to Ray-Tracing & Ray-Surface Acceleration

Ray Tracing. Foley & Van Dam, Chapters 15 and 16

CPSC GLOBAL ILLUMINATION

Ray Tracing Foley & Van Dam, Chapters 15 and 16

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

COMP371 COMPUTER GRAPHICS

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

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

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

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

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

Hidden Surface Elimination Raytracing. Pre-lecture business. Outline for today. Review Quiz. Image-Space vs. Object-Space

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

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

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

Photorealism: Ray Tracing

distribution ray tracing

distribution ray-tracing

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

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

Real-Time Shadows. Last Time? Textures can Alias. Schedule. Questions? Quiz 1: Tuesday October 26 th, in class (1 week from today!

CS559 Computer Graphics Fall 2015

Computer Graphics Global Illumination

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

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

Lecture 11: Ray tracing (cont.)

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

Computer Graphics Global Illumination

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

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

COMPLETION OF Z-buffer Graphics Pipeline

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

Ray Tracing. Outline. Ray Tracing: History

Rasterization Overview

Ray Tracing I. Internet Raytracing Competition

Supplement to Lecture 16

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

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

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

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

CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

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

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

Ray-Tracing. Misha Kazhdan

Recursion and Data Structures in Computer Graphics. Ray Tracing

Lecture 18: Primer on Ray Tracing Techniques

3D Rendering and Ray Casting

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

Review for Ray-tracing Algorithm and Hardware

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

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

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

Local vs. Global Illumination & Radiosity

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Distribution Ray Tracing

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

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

Advanced Shading I: Shadow Rasterization Techniques

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

Welcome to COMP 770 (236) Introduction. Prerequisites. Prerequisites

Interactive Cloth Simulation. Matthias Wloka NVIDIA Corporation

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

Photorealistic 3D Rendering for VW in Mobile Devices

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

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

Real-Time Shadows. Last Time? Today. Why are Shadows Important? Shadows as a Depth Cue. For Intuition about Scene Lighting

COMP environment mapping Mar. 12, r = 2n(n v) v

Lecture 11. More Ray Casting/Tracing

3D Rendering and Ray Casting

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

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

03 RENDERING PART TWO

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

The Animation Process. Lighting: Illusions of Illumination

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

CS 130 Exam I. Fall 2015

The Traditional Graphics Pipeline

Building a Fast Ray Tracer

Overview: Ray Tracing & The Perspective Projection Pipeline

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

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

Ray Tracing. Kjetil Babington

Distributed Ray Tracing

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Ray Tracing I. History

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

Speeding up your game

Chapter 7 - Light, Materials, Appearance

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Transcription:

Computer Graphics Si Lu Fall 2017 http://web.cecs.pdx.edu/~lusi/cs447/cs447_547_comp uter_graphics.htm 11/22/2017

Last time o Splines 2

Today o Raytracing o Final Exam: 14:00-15:30, Novermber 29, 2017 To-know list available 3

OpenGL Limitations o Stream processing of geometry No random access to geometric information Can t do any computation that requires all the geometry at once o Rasterization is limited We saw many ways to represent objects not all can be rasterized Cannot provide rasterizers for every form of geometry o Everything get rasterized and drawn Figuring out what you can see before rasterizing is possible but hard o Computation loops over geometry, then pixels for all objects { for all pixels in object } 4

Raytracing o Cast rays out from the eye, through each pixel, and determine what the rays hit Builds the image pixel by pixel, one at a time o Cast additional rays from the hit point to determine the pixel color o Rays test visibility what do I see from this point in this direction? Ray casting is widely used in graphics to test visibility 5

Raytracing Shadow rays Image Reflection ray Transmitted ray 6

Recursive Ray Tracing o When a reflected or refracted ray hits a surface, repeat the whole process from that point Send out more shadow rays Send out new reflected ray (if required) Send out a new refracted ray (if required) Generally, reduce the weight of each additional ray when computing the contributions to surface color Stop when the contribution from a ray is too small to notice o The result is a ray tree 7

Ray Tree B Eye A L1 L1 A L2 L2 C B C L1 L2 L1 L2 8

PCKTWTCH by Kevin Odhner, POV-Ray 9

Kettle, Mike Miller, POV- Ray 10

11

Raytracing Implementation o Raytracing breaks down into two tasks: Constructing the rays to cast Intersecting rays with geometry o The former problem is simple vector arithmetic o The intersection problem arises in many areas of computer graphics Collision detection Other rendering algorithms o Intersection is essentially root finding (as we will see) Any root finding technique can be applied 12

Constructing Rays o Define rays by an initial point and a direction o Eye rays: Rays from the eye through a pixel o Shadow rays: Rays from a point on a surface to a light If the ray hits something before it gets to the light, then the point is in shadow o Reflection rays: Rays from a point on a surface in the reflection direction Only for reflective surfaces o Transmitted rays: Rays from a point on a transparent surface through the surface Use Snell s law to get refraction direction 13

Eye Rays Image Eye (0,0,0) FOV/2 Find this point to get ray. Transform from view to world space. 14

Ray-Object Intersections o o o o Aim: Find the parameter value, t i, at which the ray first meets object i Transform the ray into the object s local coordinate system Makes ray-object intersections generic: ray-sphere, ray-plane, Write the surface of the object implicitly: f(x)=0 Unit sphere at the origin is x x-1=0 Plane with normal n passing through origin is: n x=0 Put the ray equation in for x Result is an equation of the form f(t)=0 where we want t Now it s just root finding 15

Ray-Sphere Intersection o Quadratic in t 2 solutions: Ray passes through sphere - take minimum value that is > 0 1 solution: Ray is tangent - use it if >0 0 solutions: Ray does not hit sphere 0 1 2 : 0 1 Substitute : 0 1 Sphere : ) ( Ray : 0 0 0 2 0 0 0 x x d x d d d x d x x x d x x t t t t t t 16

Ray-Plane Intersections o To do polygons, intersect with plane then do point-inpolygon test o Faster tests for triangles, but this is the start point d n x n x n d n d x n x n d x x 0 0 0 0 : 0 : 0 Substitute : 0 Plane : ) ( Ray : t t t t t 17

Details o Must find first intersection of ray from the eye Find all candidate intersections, sort them and take soonest Techniques for avoiding testing all objects o Bounding boxes that are cheap to test o Octrees for organizing objects in space Take care to eliminate intersections behind the eye Same rules apply for reflection and transmission rays o Shadow ray just has to find any intersection shadowing the light source Speedup: Keep a cache of shadowing objects - test those first 18

Mapping Techniques o All raytracing calculations are done for every pixel o Raytracing provides a wealth of information about the visible surface point: Position, normal, texture coordinates, illuminants, color o Raytracing also has great flexibility Every point is computed independently, so effects can easily be applied on a per-pixel basis Reflection and transmission and shadow rays can be manipulated for various effects Even the intersection point can be modified 19

Bump Mapping Examples 20

Soft Shadows o Light sources that extend over an area (area light sources) should cast soft-edged shadows Some points see all the light - fully illuminated Some points see none of the light source - the umbra Some points see part of the light source - the penumbra o To ray-trace area light sources, cast multiple shadow rays Each one to a different point on the light source Weigh illumination by the number that get through 21

Soft Shadows Penumbra Umbra Penumbra 22

Soft Shadows All shadow rays go through No shadow rays go through Some shadow rays go through 23

Ray-Tracing and Sampling o Basic ray-tracing casts one ray through each pixel, sends one ray for each reflection, one ray for each point light, etc o This represents a single sample for each point, and for an animation, a single sample for each frame o Many important effects require more samples: Motion blur: A photograph of a moving object smears the object across the film (longer exposure, more motion blur) Depth of Field: Objects not located at the focal distance appear blurred when viewed through a real lens system Rough reflections: Reflections in a rough surface appear blurred 24

Distribution Raytracing o Distribution raytracing casts more than one ray for each sample Originally called distributed raytracing, but the name s confusing o How would you sample to get motion blur? o How would you sample to get rough reflections? o How would you sample to get depth of field? 25

Distribution Raytracing o Multiple rays for each pixel, distributed in time, gives you motion blur Object positions have to vary continuously over time o Casting multiple reflection rays at a reflective surface and averaging the results gives you rough, blurry reflections o Simulating multiple paths through the camera lens system gives you depth of field 26

Motion Blur 27

Depth of Field http://www.cambridgeincolour.com/tutorials/depth-of-field.htm 28

Distribution Raytracing Depth of Field From Alan Watt, 3D Computer Graphics 29

Next Time o Animation 30