Implementation Issues

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

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

COMP371 COMPUTER GRAPHICS

Photorealism: Ray Tracing

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.

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

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

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

Ray-Tracing. Misha Kazhdan

Lecture 10: Ray tracing

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

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

Lighting and Reflectance COS 426

Ray tracing. EECS 487 March 19,

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

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

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

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

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

Lighting and Shading

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

Ray Tracing. Kjetil Babington

Illumination. Courtesy of Adam Finkelstein, Princeton University

Ray Tracing. CS116B Chris Pollett Apr 20, 2004.

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

Raytracing. COSC 4328/5327 Scott A. King

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

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

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

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

Ray Tracing. Quiz Discussion. Announcements: Final Projects. Last Time? Durer s Ray Casting Machine. Today

Introduction to Ray-tracing Objectives

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

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

Ray Tracing. Brian Curless CSEP 557 Fall 2016

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

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

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

Reflection and Shading

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

Intro to Ray-Tracing & Ray-Surface Acceleration

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

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

Surface Rendering Methods

Ray Tracing. Last Time? Today. Ray Casting. Durer s Ray Casting Machine. Reading for Today

Illumination Models and Surface-Rendering Methods. Chapter 10

COMP30019 Graphics and Interaction Ray Tracing

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

CPSC GLOBAL ILLUMINATION

Indirect Illumination

Sung-Eui Yoon ( 윤성의 )

Photorealism. Photorealism: Ray Tracing. Ray Tracing

Ray Tracing. Announcements: Quiz. Last Time? Today. Durer s Ray Casting Machine. Ray Casting

Ray casting. Ray casting/ray tracing

Review for Ray-tracing Algorithm and Hardware

Advanced Ray Tracing

Indirect Illumination

CS 6620 Shading. Steve Parker Peter Shirley

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

EDAN30 Photorealistic Computer Graphics. Ray tracing. Michael Doggett Department of Computer Science Lund university. Copyright 2011 Michael Doggett

CS5620 Intro to Computer Graphics

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2

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

Illumination and Shading

CS-184: Computer Graphics. Administrative

M jrs M jgs M jbs Intensity of light reflected from surface j when illuminated by source i: I ijr

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

Reflection and Refraction

Ray-tracing Cont. Ray-tracing

Reflection and Refraction

Shading, Advanced Rendering. Week 7, Wed Feb 28

CS3500 Computer Graphics Module: Lighting and Shading

Last week. Machiraju/Zhang/Möller

Given: scene specification (object positions, optical properties p of the surface, viewer position, viewing direction, )

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

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

Movie: Geri s Game. Announcements. Ray Casting 2. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

Computer Vision Systems. Viewing Systems Projections Illuminations Rendering Culling and Clipping Implementations

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

Shadows & Programmable Shaders

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

CS 325 Computer Graphics

Illumination and Shading

Ray Tracing Foley & Van Dam, Chapters 15 and 16

COMPLETION OF Z-buffer Graphics Pipeline

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

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

A Little Background. Motivation. Motivation

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

Photorealism. Ray Tracing Texture Mapping Radiosity

Distribution Ray Tracing

Institutionen för systemteknik

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

6. Illumination, Lighting

CS770/870 Spring 2017 Color and Shading

Illumination. Thomas Funkhouser Princeton University C0S 426, Fall 2000

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.

Assignment 6: Ray Tracing

Transcription:

Implementation Issues More from Interface point of view Y V U Eye N X Z World Coordinate System (WCS) Viewing Coordinate System (VCS)

View Coordinate System (VCS) Viewing coordinate system Position and orientation of the view plane Extent of the view plane (window) Position of the eye View Plane View Reference Point (VRP): the origin of VCS specified as (r x, r y, r z ) in WCS: center of the scene Normal to the view plane (n x, n y, n z )

View Coordinate System (VCS) View Plane Normal Direction (View Plane Normal VPN) n (n x,n y,n z ) User may provide normalized vector e.g. n x sin φ cos θ n y sin φ sin θ n z cos φ X Z φ r θ Y

View Coordinate System (VCS) View Plane Direction v v is a unit vector intuitively corresponding to up vector up vector is specified by the user in WCS up up (up.n)n v up / up Direction u n v up up u n x v ( Left Handed)

View Coordinate System (VCS) Window and Eye Window : left, right, bottom,top (w l,w r,w b,w t ) generally is centered at VRP (origin) w r w t Eye : e (e u,e v,e n ) Typically e (0,0,-E) n v u e w l w b

Transformation from WCS to VCS Y v r O (x, y) u ( x y ) ( a ( a u b) + r v b) M + r O X

Transformation from WCS to VCS Point object is represented as (a,b,c) in VCS (x,y,z) in WCS z y x z y x z y x n n n v v v u u u n v u M

[ ] [ ] [ ] T M r p M r p c b a r M c b a z y x p ) ( ) ( 1 + Transformation from WCS to VCS Conversion from one coordinate system to another Therefore a(p-r).u, b(p-r).v, c(p-r).n

[ ] [ ] [ ] T M r p M r p c b a r M c b a z y x p ) ( ) ( 1 + Conversion from one coordinate system to another z y x z y x z y x n n n v v v u u u n v u M (a,b,c) in VCS (x,y,z) in WCS Where 3D Viewing Interface (Revisit) Set up

Set up Steps 1. Define the view reference point (VRP) r 2. Obtain M defining u, v, n 3. Define the position of eye (in VCS) e ( e u, e v, e n ) typically ( 0, 0, -E ) corresponding point in WCS will be eye ( 0, 0, -E ) M + r 4. Define the window and the pixel location.

Set up W t v rows : 0 to MAXROW cols : 0 to MAXCOL (i,j) th pixel : (u i, v j, 0) W b n u i W l + i Δu v j W t j Δv e ( 0,0, -E) W l W r u Δu ( W r W l ) / MAXCOL Δv ( W t W b ) / MAXROW

Set up 5. Parametric equation of ray P i,j (t) eye + dir ij t eye ( 0, 0, -E ) M + r dir ij ( ( u i, v j, 0 ) e) M ( u i, v j, E ) M P ij (t) eye + dir ij t R(t) R o + R d t

Set up Find intersection with object (r i ) Find the normal at r i as r n Find intensity at I at the point (Illumination model) Find the pixel-color

Review Basic ray tracing (one level): ray casting Algorithm: For each pixel shoot a ray from eye (COP) Compute ray-object(s) intersection Obtain the closest intersection point (p) Compute normal at p Compute illumination (intensity) Set up: Obtain ray in WCS for intersection using transformations Transformation of objects: Equivalent transformation for the ray

D T 2 R 2 Eye B eye-ray A View Plane R 1 T 1 C F E

Eye C D R 1 T 1 R 2 T 2

Different Rays Eye ray (primary ray) Reflected ray Transmitted ray Shadow ray (secondary rays)

Reflected Ray Recall Reflection Vector N L θ i N θ r R L R 2 (L N) N -L R 2( L N) N L

Refracted Ray Snell s Law N I θ i sin sinθ θ i t η η t i θ t T

Refracted Ray Snell s Law I θ i N (cosθ i )N θ t M T I + (cosθi ) N M sinθi T (sinθt ) M (cos θt ) N sinθt ( I + (cos θi ) N) T (cosθt sinθi ηi T ( I + (cos θi ) N) (cos θt ) N η t ) N

L1 Eye Obj 3 Obj 1 L2 Obj 1 Obj 2

Eye Obj 3 L2 L1 Obj 1 Eye L1 L2 Obj 1 T R Obj 2 Obj 3 Obj 2

Eye Obj 3 L2 L1 Obj 1 Obj 2 L1 L2 Eye L1 L2 Obj 1 L1 T R L2 Obj 2 Obj 3 R T R

When to stop? When ray leaves the scene When the contribution to the overall intensity is small

Phong Illumination Model + + + + + + + + m i n i i s i i d a a n l s l d a a n l s l d a a total V R I k N L I k I k V R I k N L I k I k α I k θ I k I k reflection specular diffuse reflection reflection ambient I 1 ) ( ) ( ) ( ) ( cos cos Recursive Ray Tracing

Illumination When in shadow (single light source) I total ambient k I a a reflection

Illumination With reflection and transmission rays Itotal ( P) Ilocal (P) + krgi(pr ) + k tg (P ) t Global Illumination

T Whitted 1980

Other Example

Other features Ray tracing is an image based method (pixelization) Sampling aliasing Jagginess Moire patterns Anti-aliasing

Anti-alising Supersampling More number of rays per pixel Average the result