Sung-Eui Yoon ( 윤성의 )

Similar documents
INTRODUCTION TO RENDERING TECHNIQUES

Dhiren Bhatia Carnegie Mellon University

Specular reflection. Dielectrics and Distribution in Ray Tracing. Snell s Law. Ray tracing dielectrics

Hardware design for ray tracing

Computer Graphics Global Illumination (2): Monte-Carlo Ray Tracing and Photon Mapping. Lecture 15 Taku Komura

A Short Introduction to Computer Graphics

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

An introduction to Global Illumination. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Monte Carlo Path Tracing

Advanced Computer Graphics. Rendering Equation. Matthias Teschner. Computer Science Department University of Freiburg

Introduction to Computer Graphics

CSE168 Computer Graphics II, Rendering. Spring 2006 Matthias Zwicker

CUBE-MAP DATA STRUCTURE FOR INTERACTIVE GLOBAL ILLUMINATION COMPUTATION IN DYNAMIC DIFFUSE ENVIRONMENTS

Computer Applications in Textile Engineering. Computer Applications in Textile Engineering

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

Course Overview. CSCI 480 Computer Graphics Lecture 1. Administrative Issues Modeling Animation Rendering OpenGL Programming [Angel Ch.

PATH TRACING: A NON-BIASED SOLUTION TO THE RENDERING EQUATION

Lezione 4: Grafica 3D*(II)

Acceleration Methods for Ray Tracing based Global Illumination

Lecture Notes, CEng 477

Scan-Line Fill. Scan-Line Algorithm. Sort by scan line Fill each span vertex order generated by vertex list

SkillsUSA 2014 Contest Projects 3-D Visualization and Animation

Teaching Introductory Computer Graphics Via Ray Tracing

The RADIANCE Lighting Simulation and Rendering System

Advanced Rendering for Engineering & Styling

path tracing computer graphics path tracing 2009 fabio pellacini 1

Using Photorealistic RenderMan for High-Quality Direct Volume Rendering

Recent Advances and Future Trends in Graphics Hardware. Michael Doggett Architect November 23, 2005

Monte Carlo Path Tracing

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1

PHOTON mapping is a practical approach for computing global illumination within complex

B2.53-R3: COMPUTER GRAPHICS. NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions.

Computer Graphics. Introduction. Computer graphics. What is computer graphics? Yung-Yu Chuang

A Ray Tracing Solution for Diffuse Interreflection

COMP175: Computer Graphics. Lecture 1 Introduction and Display Technologies

Deferred Shading & Screen Space Effects

Chapter 10. Bidirectional Path Tracing

Modern Graphics Engine Design. Sim Dietrich NVIDIA Corporation

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Computer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

SGRT: A Scalable Mobile GPU Architecture based on Ray Tracing

ABS 731 Lighting Design & Technology. Spring 2006

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

Photon Mapping Made Easy

Approval Sheet. Interactive Illumination Using Large Sets of Point Lights

Dynamic Ray Scheduling to Improve Ray Coherence and Bandwidth Utilization

REAL-TIME IMAGE BASED LIGHTING FOR OUTDOOR AUGMENTED REALITY UNDER DYNAMICALLY CHANGING ILLUMINATION CONDITIONS

Image Synthesis. Transparency. computer graphics & visualization

PRODUCT LIFECYCLE MANAGEMENT COMPETENCY CENTRE RENDERING. PLMCC, JSS Academy of Technical Education, Noida Rendering 1 of 16

A Cross-Platform Framework for Interactive Ray Tracing

CS 371 Project 5: Midterm Meta-Specification

Computer Graphics. Geometric Modeling. Page 1. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science - Technion. An Example.

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

Path Tracing. Michael Doggett Department of Computer Science Lund university Michael Doggett

Ray Tracing on Graphics Hardware

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

Rendering Area Sources D.A. Forsyth

Computer Graphics Hardware An Overview

The Evolution of Computer Graphics. SVP, Content & Technology, NVIDIA

Visualization and Feature Extraction, FLOW Spring School 2016 Prof. Dr. Tino Weinkauf. Flow Visualization. Image-Based Methods (integration-based)

Advanced Visual Effects with Direct3D

Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. M.Sc. in Advanced Computer Science. Friday 18 th January 2008.

How To Analyze Ball Blur On A Ball Image

COMP-557: Fundamentals of Computer Graphics McGill University, Fall 2010

CS635 Spring Department of Computer Science Purdue University

Adding Animation With Cinema 4D XL

CS 431/636 Advanced Rendering Techniques"

DATA VISUALIZATION OF THE GRAPHICS PIPELINE: TRACKING STATE WITH THE STATEVIEWER

Dynamic Resolution Rendering

Introduction Week 1, Lecture 1

Lecture 15: Hardware Rendering

Path tracing everything. D.A. Forsyth

Triangle Scan Conversion using 2D Homogeneous Coordinates

Introduction to Computer Graphics. Reading: Angel ch.1 or Hill Ch1.

Instructor. Goals. Image Synthesis Examples. Applications. Computer Graphics. Why Study 3D Computer Graphics?

NVPRO-PIPELINE A RESEARCH RENDERING PIPELINE MARKUS TAVENRATH MATAVENRATH@NVIDIA.COM SENIOR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA

1. INTRODUCTION Graphics 2

Convex Mirrors. Ray Diagram for Convex Mirror

GPU(Graphics Processing Unit) with a Focus on Nvidia GeForce 6 Series. By: Binesh Tuladhar Clay Smith

Hi everyone, my name is Michał Iwanicki. I m an engine programmer at Naughty Dog and this talk is entitled: Lighting technology of The Last of Us,

Lecture 12: Cameras and Geometry. CAP 5415 Fall 2010

Graphical displays are generally of two types: vector displays and raster displays. Vector displays

Making natural looking Volumetric Clouds In Blender 2.48a

Realtime Ray Tracing and its use for Interactive Global Illumination

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

How an electronic shutter works in a CMOS camera. First, let s review how shutters work in film cameras.

Touchstone -A Fresh Approach to Multimedia for the PC

Masters of Science in Software & Information Systems

Lighting & Rendering in Maya: Lights and Shadows

Contents Rendering Reference

Motivation. Motivation

One Step Closer to a Fully Realistic 3D World on the Consumer PC A White Paper on the 3dfx T-Buffer

SGRT: A Mobile GPU Architecture for Real-Time Ray Tracing

Materials in NX Render

Clustering & Visualization

1. Definition of the project. 2. Initial version (simplified texture) 3. Second version (full textures) 5. Modelling and inserting 3D objects

Visibility Map for Global Illumination in Point Clouds

Real-Time Realistic Rendering. Michael Doggett Docent Department of Computer Science Lund university

Efficient Storage, Compression and Transmission

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 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 I numlights j j j j j j n r (k aia k did(n ˆ Lˆ j) k sis(v ˆ R) ˆ s ) j1 Whitted model I r num_visible_lights j1 (k j a I j a k j d I j d (Nˆ Lˆ j )) k s S 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] I r numlights j1 (k j a I j a k j d I j d (Nˆ Lˆ j )) k s S k t T Computing reflection and transmitted/refracted rays is based on Snell s law (refer to Chapter 13.1) 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: np d0 n(o td) d0 t(nd) dno d no 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

22 Barycentric Coordinates Points in a triangle have positive barycentric coordinates: v 1 v 2 v 3 p ) ( ) ( 0 2 0 1 0 v v v v v p 2 1 0 ) 1 ( v v v p 2 1 0 v v v p 1,where v 0 v 1 v 2 p

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 Refer to Sec. 4.4.2 in the textbook for the detail equations 24

Robustness Issues False self-intersections One solution is to offset the origin of the ray from the surface when tracing secondary rays Secondary ray 25

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 26

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 27

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. 28 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 29

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 30

31 Kd-tree: Example

32 Kd-tree: Example

33 Kd-tree: Example

34 Example

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

36 Kd-tree: Example

Split Planes How to select axis & split plane? Largest dimension, subdivide in middle More advanced: Surface area heuristic Makes large difference 50%-100% higher overall speed 37

Median vs. SAH (from [Wald04]) 38

Ray Tracing with kd-tree Goal: find closest hit with scene Traverse tree front to back (starting from root) At each node: If leaf: intersect with triangles If inner: traverse deeper 39

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

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: 41

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

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 43

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. 44

Jittering Results for Antialiasing 2x2 sub-sampling 45

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 46

Depth of Field image plane lens focal plane 47

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 48

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

50 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 51

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 2015 52