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

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

Virtual Reality for Human Computer Interaction

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Ray Tracing. Shandong University

Shading I Computer Graphics I, Fall 2008

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

Ray Tracing: Intersection

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

Comp 410/510 Computer Graphics. Spring Shading

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

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

CPSC GLOBAL ILLUMINATION

Introduction to Computer Graphics 7. Shading

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

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

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

Illumination & Shading

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

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

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

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

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

WHY WE NEED SHADING. Suppose we build a model of a sphere using many polygons and color it with glcolor. We get something like.

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

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

03 RENDERING PART TWO

Assignment 6: Ray Tracing

COMP371 COMPUTER GRAPHICS

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

CS452/552; EE465/505. Intro to Lighting

Lecture 12: Advanced Rendering

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Lighting. Figure 10.1

Shading. Why we need shading. Scattering. Shading. Objectives

Global Illumination. COMP 575/770 Spring 2013

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

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

RAYTRACING. Christopher Peters INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION. HPCViz, KTH Royal Institute of Technology, Sweden

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

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

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

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

Supplement to Lecture 16

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

Lecture 11: Ray tracing (cont.)

CS5620 Intro to Computer Graphics

Lecture 18: Primer on Ray Tracing Techniques

Computer Graphics. Bing-Yu Chen National Taiwan University

COMPUTER GRAPHICS AND INTERACTION

CEng 477 Introduction to Computer Graphics Fall 2007

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

Introduction to Computer Graphics with WebGL

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

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

Lighting and Shading

Sung-Eui Yoon ( 윤성의 )

Global Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

CHAPTER 1 Graphics Systems and Models 3

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

COM337 COMPUTER GRAPHICS Other Topics

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

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

Spatial Data Structures

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Illumination. The slides combine material from Andy van Dam, Spike Hughes, Travis Webb and Lyn Fong

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

782 Schedule & Notes

Shadows & Programmable Shaders

COMPLETION OF Z-buffer Graphics Pipeline

Computer Graphics I Lecture 11

Shadows. COMP 575/770 Spring 2013

Anti-aliasing. Images and Aliasing

Models and Architectures

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

Spatial Data Structures

Intro to Ray-Tracing & Ray-Surface Acceleration

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

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

Ray tracing. Methods of Programming DV2. Introduction to ray tracing and XML. Forward ray tracing. The image plane. Backward ray tracing

Graphics for VEs. Ruth Aylett

Spatial Data Structures

Chapter 7 - Light, Materials, Appearance

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Topic 10: Scene Management, Particle Systems and Normal Mapping. CITS4242: Game Design and Multimedia

Visualisatie BMT. Rendering. Arjan Kok

Pipeline Operations. CS 4620 Lecture 10

Recursion and Data Structures in Computer Graphics. Ray Tracing

CS 488. More Shading and Illumination. Luc RENAMBOT

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics V. Guoying Zhao 1 / 65

Final Project: Real-Time Global Illumination with Radiance Regression Functions

6. Illumination, Lighting

Spatial Data Structures

Raytracing CS148 AS3. Due :59pm PDT

Spatial Data Structures

Reflection and Shading

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Shading, Advanced Rendering. Week 7, Wed Feb 28

Assignment 2 Ray Tracing

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

Transcription:

Effects needed for realism Global Rendering Computer Graphics 1, Fall 2005 Lecture 7 4th ed.: Ch 6.10, 12.1-12.5 Shadows Reflections (Mirrors) Transparency Interreflections Detail (Textures etc.) Complex Illumination Realistic Materials and many more The Rendering Equation The infinite scattering and absorption of light can be described by the rendering equation Cannot be solved in general A ray tracer is best suited for perfectly reflecting surfaces A radiosity renderer is best suited for perfectly diffuse surfaces Global effects of the rendering equation shadow multiple reflection translucent surface Local vs global rendering Correct shading requires a global calculation involving all objects and all light sources Incompatible with the pipeline model which shades each polygon independently (local rendering) However, in computer graphics, especially real-time graphics, we are happy if things look right There exist many techniques for approximating global effects Light-material interaction Light that strikes an object is partially absorbed and partially scattered (reflected) The amount reflected determines the color and brightness of the object The reflected light is scattered in a manner that depends on the smoothness and orientation of the surface Ingela Nyström 1

Ambient light only Diffuse light Diffuse shading is based on the principal that more light hits the surface of an object where the angle between the surface normal and the vector from the intersection to the light is least Source:www.2tothex.com/rayt Camera light source: no shadows Shadows Shadows are simple to compute in a ray tracer. A point is in shadow if a ray from that point to the light source intersects an object Source: www.2tothex.com/raytracing/ The point of intersection of a ray and the object has already been calculated in order to apply diffuse shading Distant light source: parallel rays Point light source: see shadows Ingela Nyström 2

Spotlight: cone angle 30, high contrast Spotlight - soft shadows Effect of distance - no attenuation Effect of distance - attenuation 1/distance Effect of distance more attenuation Global illumination Ray tracing Radiosity Image sources and ray tracer: http://www.povray.org http://www.irtc.org 1/(distance) 2 Ingela Nyström 3

Ray tracing Recursive ray tracing function I reflected and I transmitted are calculated recursively color c = trace(point p, vector d, int step) { color local, refl, trans; point q; normal n; camera pixel positions on view plane See pseudo-code on page 630, Angel 4th ed. if (step > MAX) return bgr; q = intersect(p, d, status); if (status == light_source) return light; if (status == no_intersect) return bgr; n = normal(q); r = reflect(q, n); t = transmit(q, n); Intensity calculation: I = I local + k r * I reflected + k t * I transmitted local = phong(q, n, r); refl = trace(q, r, step+1); trans = trace(q, t, step+1); } return(local+refl+trans); Recursive ray tracing The recursion will stop if the maximum no of steps is reached returns background colour if the ray does not intersect any object returns background colour Advantages and disadvantages Ray tracing is attractive because shadows and reflections are easily incorporated Ray tracing is expensive because the cost of computing ray-object intersections is very high if the ray intersects the light source returns light source colour Reflections Ray tracing paths form a ray tree Reflections are generated using ray tracing. In real life, the interaction of light with a reflective object occurs as follows: 1. A light source emits photons 2. Photons collide with and bounce off objects (some energy is absorbed and we see colour) 3. Photons travel into the eye Ra Tc C Rc Ra A PRP D Rb Ta B A Ra C Rc Tc D Rd Ta B Rb Perspective Reference Point Ingela Nyström 4

Calculating intersections The bottle-neck lies in the computation of intersections between ray and object Limit the objects to which we find ray intersections easily sphere plane inside/outside polygon Bounding volumes Enclose groups of objects in a simple bounding volume (sphere or box) Test for intersection against bounding volume if no intersection, then ray does not intersect objects within the bounding volume if intersection occurs, then test against each object in turn How do we subdivide space? One idea is octree partitioning We illustrate in 2D - known as quadtree Octree A tree structure emerges, with the nodes at the leaves of the tree containing (hopefully) a small number of objects, or empty First divide space into four regions Count number of objects in each region If a region contains an object, subdivide again Continue to a specified level of subdivision This is a quadtree in 3D, we subdivide the cube into 8 each time, getting an octree Ray tracing through octree We trace the ray from subregion to subregion, only performing intersection tests for the small number of objects in the subregion Find the region corresponding to the start point. Test ray for intersections with any objects. Finding region containing (x,y,z) We use the octree to locate the region containing (x,y,z). Starting at the top, a simple test determines which of the 8 (4 for quadtree) regions that contains the point. Proceed down the tree until leaf node reached. If none, find the next region by calculating intersection with the region boundaries. Advance a short way into next region - say to (x,y,z) Find the region that includes (x,y,z) and continue. Ingela Nyström 5

Binary space partitioning An alternative to octrees is to split the space into two at each step a separating plane is typically chosen to divide the space into regions of equal complexity Known as Binary Space Partitioning (BSP) trees Octrees vs BSP trees Octrees: good for scenes where density of objects varies widely possible to have small objects in large regions stepping from region to region slow because trees tend to be unbalanced BSP trees: depth of tree small because tree balanced memory costs lower void areas smaller The room model Local models do not consider indirect illumination Direct Direct P b B P a A Global models consider indirect illumination P b Indirect B Indirect P a A Global models ray tracing, radiosity Ingela Nyström 6

Radiosity The opposite of ray-tracing The light-transfer calculations are based solely on the geometry of the environment There is no view position or viewer Radiosity Radiosity considers only the interaction of light with surfaces in the environment The benefit of this algorithm is that visual brightness for each object need only be calculated once Ingela Nyström 7

Which one looks real? 3D Photorealistic Rendering 1. Wire-frame Less Realism 2. Hidden-surface removal 3. Local illumination 4. Global illumination More Realism Ingela Nyström 8

The POVRAY Teapot Ingela Nyström 9