# Assignment 2 Ray Tracing

Size: px
Start display at page:

## Transcription

1 Assignment 2 Ray Tracing Overview The concept of ray tracing: a technique for generating an image by tracing the path of light through pixels in an image plane and simulating the effects of its encounters with virtual objects. The technique is capable of producing a very high degree of visual realism, usually higher than that of typical scan line rendering methods, but at a greater computational cost. The objective of this exercise is to implement a ray casting/tracing engine. A ray tracer shoots rays from the observer s eye through a screen and into a scene of objects. It calculates the ray s intersection with objects, finds the nearest intersection and calculates the color of the surface 1

2 according to its material and lighting conditions. (This is the way you should think about it this will help your implementation). 2

3 Requirements Read this entire explanation before starting. Understand the slides taught in class especially. The feature set you are required to implement in your ray tracer is as follows: Background o Black Display geometric primitives in space: o Spheres o Planes Basic lighting o Directional lights o Spot lights o Ambient light o Simple materials (ambient, diffuse, specular...) Basic hard shadows One Reflection (10 Points bonus) Scene Definition The 3D scene your ray tracer which will be rendering will be defined in a scene definition text file. The scene definition contains all of the parameters required to render the scene and the objects in it. The specific language used in the definition file is defined later. 3

4 Geometry Geometric primitives Sphere A sphere is defined by a center point and scalar radius. The normal of each point on the sphere s surface is easily computed as the normalized subtraction of the point and the center. Plane Plane is always a rectangle. A plane is defined by a point represents the center of the plane, a normal vector to the plane, width and length. Every plane has white 32X32 checker board pattern. You can Assume that the normal of a plane has one zero coordinate and one edge of the plane is parallel to one of the axis. For example if the normal is (1,1,0) then one edge direction is (0,0,1) and second edge direction is (1,-1,0). Spheres and planes can intersect each other. Background The background of the rendered scene is black. Camera The camera is a simple pinhole camera as described in the lecture slides and will be located at (0,0,0). Camera direction will be toward (image plane center). Lighting Basic lights and shadows For basic lighting you need to implement: 4

5 1. Ambient lighting a color that reflects from all surfaces with equal intensity. 2. Directional A light source like the sun, which lies at infinity and has just a direction. 3. Spot light A point light source that illuminates in a direction given by a vector. This light source has a cutoff angle as describe in the following image. Every light source has its own intensity (color) and there can be multiple light sources in a scene. Shadows appear where objects obscure a light source. In the equation they are expressed in the term. To know if a point in space (usually on a surface) lies in a shadow of a light source, you need to shoot a ray from in the direction of the light and check if it hits something. If it does, make sure that it really hits it before reaching the light source and that the object hit is not actually a close intersection with the object the ray emanated from. Materials You need to implement the lighting formula (Phong) from the lecture slides. The material of a surface should be flat with ambient, diffuse, specular reflections, and a shininess parameter (the power of ). The first 4 parameters are RGB colors. Shadow You can choose to add shadow effect to your scene using parameter in Phong model (see lecture slides). Shadow appears when some object located between the light source and another object which can be observed by the viewer. In that case you should ignore the covered light source part in Phong model. Some common mistakes may cause spurious shadows to appear. Make sure you understand the vector math involved and all the edge-cases. Reflection (10 points bonus) You can choose implement planes which is defined in the objects file to be a mirror. Each ray hit a mirror plane breaks symmetrically to the normal (include light rays). The color of the pixel in a mirror plane is calculating according to the breaking ray. Don't forget to consider the light sources rays which break by the mirror plane. If you choose to implement this task ignore mirror objects material parameters: ambient, diffuse, specular reflections. Mirror will be uniform (without squares). Mirror plane will be signed by M at the end of the parameters list. 5

6 Fisheye lens (10 points bonus) Create a fisheye effect. You may make it by calculating the ray reflectance from fisheye lens which is located between the screen and the scene or between the eye and the screen. Further reading: If you implement this bonus run your program with argument "fish" to see the scene through fish eye lens (when running without parameters the program show the original scene). Up to 10 bonus points will be given for extremely interesting scene you build. Submit init.txt file and output image of your ray tracer. Every additional advanced feature (as acceleration, transparency, environmental light) will give you extra points. 6

7 Input You will get one text file named init.txt. The first line in the file will start with the word "scene" following by (screen center coordinates x, y, z), up vector (x, y, z), w width of the scene, when ( ) is Image resolution (you can assume that ) and Ambient lighting (R, G, B coordinate). 12 parameters total which are separated by commas. Image plane normal is the vector From the second row we will describe the object in the scene: Light will describe by "light" keyword following by light direction (x, y, z), light intensity (R, G, B) and if it is a spotlight light position (x, y, z) and light cutoff angle. 6 or 10 parameters total. Sphere will describe by "spher" keyword following by the sphere center coordinate (x,y,z), radius, material parameters each one has 3 components (R, G, B) and shininess parameter. 14 parameters total. Plane will describe by "plane" keyword following by the a normal to the plane coordinates (x,y,z), center of plane point coordinates (x,y,z),width and length, material parameters each one has 3 components (R, G, B) and shininess parameter. 18 parameters total. If you choose to implement reflection bonus, you generate each object that signed with "M" at the end of the line as a mirror. Input example: scene 0,0,-2,0,1,0,2,512,512,0.5,0.1,0.8 light 1,1,1,0.3,0.2,0.6 light 1,-1,1,0.9,0.1,0.6,0,4,-5.5,30 spher 0,0,-5,1.5,0.3,0.3,0.3,0.4,0.4,0,0.1,0.7,0,5 plane 0,1,0,0,-2,0,100,100, 0.3,0,0.3,0.4,0,0,0.1,0.7,0,20 M Notes Recommended Milestones Design Before you start coding! You should think carefully about the structure and design of your system. Take the time to define interfaces, classes and interactions between objects. Implementing a ray tracer poses an array of opportunities for creating good OOP design Make sure you take advantage of them. Write incrementally. Start from a small scene with one or two objects. 7

8 Validation We will provide you with sample scenes for validation and the way they are supposed to render in your ray tracer. Your implementation may vary from the supplied image in little details but in general the scene should look the same. Some general hints: A color can be seen as a vector that points from black (0,0,0) to a point in the RGB space. Use the Vector3f class to handle vectors and RGB. Before plotting a pixel, make sure that its color does not exceed the range of 0-1 for every color channel. Right vector of the screen will be orthogonal to up vector and toward vector (see slide 42 of PS 3. Use 'fscanf' and fseek function to read parameter from file. Example: float var; FILE *f; //file discriptor Fseek(f,5,SEEK_CUR); //skip 5 character from the current position in the file fscanf(f,"%f,",&var); //put a float number into var and return 1 when succeed Submission: Submission is in pairs. Everything should be submitted inside a single zip file named <ID1> _<ID2>.zip The zip file should include all of your.h files and.cpp files or your project if you use VS. 8

9 Appendix A Step by Step Guidance Following are some practical suggestions that could make the exercise easier for you. There are many other ways to approach it as well, and you don't necessarily have to follow these directions. 1. Make sure you read the scene definition file correctly. 2. Define you C++ object for each light source, sphere and a plane. 3. Try to render small scenes with one light and one or two objects. 4. Add lights and compare your results which friends. 5. Implement lighting types. 6. Add support for shadows and reflection by recursively shooting additional rays. 7. Go through the exercise definition and make sure you haven't forgotten anything. 8. Debugging: An easy way to start debugging is to find a pixel where you know something is wrong and try to debug the calculation of that specific pixel. Say you found there is a problem at (344, 205), You can start by writing something like this: if (x == 344 && y == 205) printf("yo!"); // set breakpoint here. You can also print to a log file. Helpful links:

10 Good Luck! 10

### The feature set you are required to implement in your ray tracer is as follows (by order from easy to hard):

Ray Tracing exercise TAU, Computer Graphics, 0368.3014, semester B Go to the Updates and FAQ Page Overview The objective of this exercise is to implement a ray casting/tracing engine. Ray tracing is a

### Practical 2: Ray Tracing

2017/2018, 4th quarter INFOGR: Graphics Practical 2: Ray Tracing Author: Jacco Bikker The assignment: The purpose of this assignment is to create a small Whitted-style ray tracer. The renderer should be

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

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007 Programming For this assignment you will write a simple ray tracer. It will be written in C++ without

### Ray Tracer Due date: April 27, 2011

Computer graphics Assignment 4 1 Overview Ray Tracer Due date: April 27, 2011 In this assignment you will implement the camera and several primitive objects for a ray tracer, and a basic ray tracing algorithm.

### Assignment 6: Ray Tracing

Assignment 6: Ray Tracing Programming Lab Due: Monday, April 20 (midnight) 1 Introduction Throughout this semester you have written code that manipulated shapes and cameras to prepare a scene for rendering.

### Computer Graphics Tick 1

Computer Graphics Tick 1 Introduction to Ray Tracing Figure 1: The image you will create in this exercise. 1 Introduction In this exercise you will write code for a simple ray tracer. Ray tracing is a

### Virtual Reality for Human Computer Interaction

Virtual Reality for Human Computer Interaction Appearance: Lighting Representation of Light and Color Do we need to represent all I! to represent a color C(I)? No we can approximate using a three-color

### Ray-Tracing. Misha Kazhdan

Ray-Tracing Misha Kazhdan Ray-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Goal: Ray-Tracing Take a collection of triangles representing a 3D scene and render

### Photorealism: Ray Tracing

Photorealism: Ray Tracing Reading Assignment: Chapter 13 Local vs. Global Illumination Local Illumination depends on local object and light sources only Global Illumination at a point can depend on any

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

Basic Ray Tracing Rendering: Reality Eye acts as pinhole camera Photons from light hit objects Rendering: Reality Eye acts as pinhole camera Photons from light hit objects Rendering: Reality Eye acts as

### Raytracing CS148 AS3. Due :59pm PDT

Raytracing CS148 AS3 Due 2010-07-25 11:59pm PDT We start our exploration of Rendering - the process of converting a high-level object-based description of scene into an image. We will do this by building

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

To do Continue to work on ray programming assignment Start thinking about final project Lighting Course Outline 3D Graphics Pipeline Modeling (Creating 3D Geometry) Mesh; modeling; sampling; Interaction

Lighting and Shading Today: Local Illumination Solving the rendering equation is too expensive First do local illumination Then hack in reflections and shadows Local Shading: Notation light intensity in,

### Topics and things to know about them:

Practice Final CMSC 427 Distributed Tuesday, December 11, 2007 Review Session, Monday, December 17, 5:00pm, 4424 AV Williams Final: 10:30 AM Wednesday, December 19, 2007 General Guidelines: The final will

### Ray Tracing COMP575/COMP770

Ray Tracing COMP575/COMP770 1 Ray tracing idea 2 Ray Tracing: Example (from [Whitted80]) Ray Tracing: Example Ray Tracing for Highly Realistic Images Volkswagen Beetle with correct shadows and (multi-)reflections

### COMP371 COMPUTER GRAPHICS

COMP371 COMPUTER GRAPHICS SESSION 15 RAY TRACING 1 Announcements Programming Assignment 3 out today - overview @ end of the class Ray Tracing 2 Lecture Overview Review of last class Ray Tracing 3 Local

### CS 465 Program 5: Ray II

CS 465 Program 5: Ray II out: Friday 2 November 2007 due: Saturday 1 December 2007 Sunday 2 December 2007 midnight 1 Introduction In the first ray tracing assignment you built a simple ray tracer that

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

Now Playing: Movie: For The Birds Pixar, 2000 Liar Built To Spill from You In Reverse Released April 11, 2006 Ray Tracing 1 Rick Skarbez, Instructor COMP 575 November 1, 2007 Announcements Programming

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

Methods of Programming DV2 Introduction to ray tracing and XML Ray tracing Suppose we have a description of a 3-dimensional world consisting of various objects spheres, triangles (flat), planes (flat,

### Programming projects. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer

Programming projects Rendering Algorithms Spring 2010 Matthias Zwicker Universität Bern Description of assignments on class webpage Use programming language and environment of your choice We recommend

### Ray Tracing. Kjetil Babington

Ray Tracing Kjetil Babington 21.10.2011 1 Introduction What is Ray Tracing? Act of tracing a ray through some scene Not necessarily for rendering Rendering with Ray Tracing Ray Tracing is a global illumination

### CS5620 Intro to Computer Graphics

So Far wireframe hidden surfaces Next step 1 2 Light! Need to understand: How lighting works Types of lights Types of surfaces How shading works Shading algorithms What s Missing? Lighting vs. Shading

### Lighting. Figure 10.1

We have learned to build three-dimensional graphical models and to display them. However, if you render one of our models, you might be disappointed to see images that look flat and thus fail to show the

### Shading I Computer Graphics I, Fall 2008

Shading I 1 Objectives Learn to shade objects ==> images appear threedimensional Introduce types of light-material interactions Build simple reflection model Phong model Can be used with real time graphics

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

CS130 : Computer Graphics Lecture 8: Lighting and Shading Tamar Shinar Computer Science & Engineering UC Riverside Why we need shading Suppose we build a model of a sphere using many polygons and color

### Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001

Computer graphics Assignment 5 1 Overview Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001 In this assignment you will implement the camera and several primitive objects for a ray tracer. We

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

Ray Tracing Part 1 CSC418/2504 Introduction to Computer Graphics TA: Muhammed Anwar & Kevin Gibson Email: manwar@cs.toronto.edu Overview Introduction / Motivation Rasterization vs Ray Tracing Basic Pseudocode

### Lecture 18: Primer on Ray Tracing Techniques

Lecture 18: Primer on Ray Tracing Techniques 6.172: Performance Engineering of Software Systems Joshua Slocum November 16, 2010 A Little Background Image rendering technique Simulate rays of light - ray

### Homework #2. Shading, Ray Tracing, and Texture Mapping

Computer Graphics Prof. Brian Curless CSE 457 Spring 2000 Homework #2 Shading, Ray Tracing, and Texture Mapping Prepared by: Doug Johnson, Maya Widyasari, and Brian Curless Assigned: Monday, May 8, 2000

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

Recollection Models Pixels Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows Can be computed in different stages 1 So far we came to Geometry model 3 Surface

### Interactive Real-Time Raycasting

Interactive Real-Time Raycasting CS184 AS4 Due 2009-02-26 11:00pm We start our exploration of Rendering - the process of converting a high-level object-based description into a graphical image for display.

### Computer Graphics I. Assignment 3

UNIVERSITÄT DES SAARLANDES Dr.-Ing. Hendrik P.A. Lensch Max Planck Institut Informatik Art Tevs (tevs@mpi-inf.mpg.de) Boris Ajdin (bajdin@mpi-inf.mpg.de) Matthias Hullin (hullin@mpi-inf.mpg.de) 12. November

### A Little Background. Motivation. Motivation

A Little Background Ray casting Process of shooting rays into scene to get pixel colors Nonrecursive, i.e., no interreflections Origin: Arthur Appel, 1968 (earlier work by others for nonrendering) Ray

### CS 184: Assignment 4 Simple Raytracer

CS 184: Assignment 4 Simple Raytracer Ravi Ramamoorthi 1 Introduction This assignment asks you to write a first simple raytracer. Raytracers can produce some of the most impressive renderings, with high

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

Orthogonal Projection Matrices 1 Objectives Derive the projection matrices used for standard orthogonal projections Introduce oblique projections Introduce projection normalization 2 Normalization Rather

### Lecture 15: Shading-I. CITS3003 Graphics & Animation

Lecture 15: Shading-I CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Learn that with appropriate shading so objects appear as threedimensional

### CS 4620 Program 4: Ray II

CS 4620 Program 4: Ray II out: Tuesday 11 November 2008 due: Tuesday 25 November 2008 1 Introduction In the first ray tracing assignment you built a simple ray tracer that handled just the basics. In this

### CHAPTER 1 Graphics Systems and Models 3

?????? 1 CHAPTER 1 Graphics Systems and Models 3 1.1 Applications of Computer Graphics 4 1.1.1 Display of Information............. 4 1.1.2 Design.................... 5 1.1.3 Simulation and Animation...........

### The University of Calgary

The University of Calgary Department of Computer Science Final Examination, Questions ENEL/CPSC 555 Computer Graphics Time: 2 Hours Closed Book, calculators are permitted. The questions carry equal weight.

### Intro to Ray-Tracing & Ray-Surface Acceleration

Lecture 12 & 13: Intro to Ray-Tracing & Ray-Surface Acceleration Computer Graphics and Imaging UC Berkeley Course Roadmap Rasterization Pipeline Core Concepts Sampling Antialiasing Transforms Geometric

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

CSCI 420 Computer Graphics Lecture 15 Ray Tracing Ray Casting Shadow Rays Reflection and Transmission [Ch. 13.2-13.3] Jernej Barbic University of Southern California 1 Local Illumination Object illuminations

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

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

Visual cues to 3D geometry Light Reflection and Advanced Shading size (perspective) occlusion shading CS 4620 Lecture 17 1 2 Shading Recognizing materials Variation in observed color across an object strongly

### Review for Ray-tracing Algorithm and Hardware

Review for Ray-tracing Algorithm and Hardware Reporter: 邱敬捷博士候選人 Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Summer, 2017 1 2017/7/26 Outline

### Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Lighting and Shading Slides: Tamar Shinar, Victor Zordon Why we need shading Suppose we build a model of a sphere using many polygons and color each the same color. We get something like But we want 2

### Comp 410/510 Computer Graphics. Spring Shading

Comp 410/510 Computer Graphics Spring 2017 Shading Why we need shading Suppose we build a model of a sphere using many polygons and then color it using a fixed color. We get something like But we rather

### CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

CENG 477 Introduction to Computer Graphics Ray Tracing: Shading Last Week Until now we learned: How to create the primary rays from the given camera and image plane parameters How to intersect these rays

### The exam begins at 2:40pm and ends at 4:00pm. You must turn your exam in when time is announced or risk not having it accepted.

CS 184: Foundations of Computer Graphics page 1 of 12 Student Name: Student ID: Instructions: Read them carefully! The exam begins at 2:40pm and ends at 4:00pm. You must turn your exam in when time is

### Shading. Brian Curless CSE 557 Autumn 2017

Shading Brian Curless CSE 557 Autumn 2017 1 Reading Optional: Angel and Shreiner: chapter 5. Marschner and Shirley: chapter 10, chapter 17. Further reading: OpenGL red book, chapter 5. 2 Basic 3D graphics

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

Computer Graphics Ray Tracing Based on slides by Dianna Xu, Bryn Mawr College Ray Tracing Example Created by Anto Matkovic Ray Tracing Example Ray Tracing Example Ray Tracing Most light rays do not reach

Illumination Models & Shading Lighting vs. Shading Lighting Interaction between materials and light sources Physics Shading Determining the color of a pixel Computer Graphics ZBuffer(Scene) PutColor(x,y,Col(P));

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

Now Playing: Movie: Geri s Game Pixar, 1997 Academny Award Winner, Best Short Film Quicksand Under Carpet New Radiant Storm King from Leftover Blues: 1991-003 Released 004 Ray Casting Rick Skarbez, Instructor

### Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Shading Models There are two main types of rendering that we cover, polygon rendering ray tracing Polygon rendering is used to apply illumination models to polygons, whereas ray tracing applies to arbitrary

### TDA361/DIT220 Computer Graphics, January 15 th 2016

TDA361/DIT220 Computer Graphics, January 15 th 2016 EXAM (Same exam for both CTH- and GU students) Friday January 15 th, 2016, 8.30 12.30 Examiner Ulf Assarsson, tel. 0701-738535 Permitted Technical Aids

### 03 RENDERING PART TWO

03 RENDERING PART TWO WHAT WE HAVE SO FAR: GEOMETRY AFTER TRANSFORMATION AND SOME BASIC CLIPPING / CULLING TEXTURES AND MAPPING MATERIAL VISUALLY DISTINGUISHES 2 OBJECTS WITH IDENTICAL GEOMETRY FOR NOW,

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

CS354 Computer Graphics Ray Tracing Qixing Huang Januray 24th 2017 Graphics Pipeline Elements of rendering Object Light Material Camera Geometric optics Modern theories of light treat it as both a wave

### MITOCW MIT6_172_F10_lec18_300k-mp4

MITOCW MIT6_172_F10_lec18_300k-mp4 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for

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

Now Playing: Luxo Jr. (Pixar, 1986) Giant Steps From Giant Steps Recorded May 4-5, 1959 John Coltrane - Tenor Sax Tommy Flanagan - Piano Paul Chambers - Bass Art Taylor - Drums Real Cameras and Ray Tracing

### lecture 18 - ray tracing - environment mapping - refraction

lecture 18 - ray tracing - environment mapping - refraction Recall Ray Casting (lectures 7, 8) for each pixel (x,y) { cast a ray through that pixel into the scene, and find the closest surface along the

### Shadows. COMP 575/770 Spring 2013

Shadows COMP 575/770 Spring 2013 Shadows in Ray Tracing Shadows are important for realism Basic idea: figure out whether a point on an object is illuminated by a light source Easy for ray tracers Just

### Ray tracing idea. Ray Tracing. Ray tracing algorithm. Plane projection in drawing. CS 465 Lecture 3

Ray tracing idea Ray Tracing CS 465 Lecture 3 2007 Doug James 1 2007 Doug James 2 Ray tracing algorithm Plane projection in drawing for each pixel { compute viewing ray intersect ray with scene compute

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

CS 428: Fall 2009 Introduction to Computer Graphics Raytracing 11/18/2009 1 Forward ray tracing From the light sources Simulate light transport one ray at a time Rays start from lights + bounce around

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

15-462 Computer Graphics I Lecture 7 Lighting and Shading February 12, 2002 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/ Light Sources Phong Illumination Model

### COMPUTER GRAPHICS AND INTERACTION

DH2323 DGI17 COMPUTER GRAPHICS AND INTERACTION INTRODUCTION TO RAYTRACING Christopher Peters CST, KTH Royal Institute of Technology, Sweden chpeters@kth.se http://kth.academia.edu/christopheredwardpeters

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

Lecture 17: Recursive Ray Tracing Where is the way where light dwelleth? Job 38:19 1. Raster Graphics Typical graphics terminals today are raster displays. A raster display renders a picture scan line

### CS Simple Raytracer for students new to Rendering

CS 294-13 Simple Raytracer for students new to Rendering Ravi Ramamoorthi This assignment should be done only by those small number of students who have not yet written a raytracer. For those students

### Deferred Rendering Due: Wednesday November 15 at 10pm

CMSC 23700 Autumn 2017 Introduction to Computer Graphics Project 4 November 2, 2017 Deferred Rendering Due: Wednesday November 15 at 10pm 1 Summary This assignment uses the same application architecture

### Introduction to Ray-tracing Objectives

Introduction to Ray-tracing Objectives Define ray-tracing as a means of rendering Ray-tracing for spheres Combining with shading model An algorithm framework 2 1 Light vs. Rendering 3 (Local) Ray-tracing

### Lecture 11: Ray tracing (cont.)

Interactive Computer Graphics Ray tracing - Summary Lecture 11: Ray tracing (cont.) Graphics Lecture 10: Slide 1 Some slides adopted from H. Pfister, Harvard Graphics Lecture 10: Slide 2 Ray tracing -

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

Lecture 11 Ray tracing Introduction Projection vs. ray tracing Projection Ray tracing Rendering Projection vs. ray tracing Projection Ray tracing Basic methods for image generation Major areas of computer

### Glass Gambit: Chess set and shader presets for DAZ Studio

Glass Gambit: Chess set and shader presets for DAZ Studio This product includes a beautiful glass chess set, 70 faceted glass shader presets and a 360 degree prop with 5 material files. Some people find

### L15 POV-Ray - Part 1

Geophysical Computing L15-1 L15 POV-Ray - Part 1 1. What is POV-Ray? POV-Ray stands for the Persistance of Vision Raytracer. POV-Ray belongs to a class of programs called ray tracers. For you seismologists

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

DH2323 DGI15 INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION RAYTRACING HPCViz, KTH Royal Institute of Technology, Sweden http://kth.academia.edu/christopheredwardpeters Based on DGI12 notes by Carl

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

Last Time? Real-Time Shadows Perspective-Correct Interpolation Texture Coordinates Procedural Solid Textures Other Mapping Bump Displacement Environment Lighting Textures can Alias Aliasing is the under-sampling

### Lecture 11. More Ray Casting/Tracing

Lecture 11 More Ray Casting/Tracing Basic Algorithm For each pixel { } Shoot a ray from camera to pixel for all objects in scene Compute intersection with ray Find object with closest intersection Display

### Previously... contour or image rendering in 2D

Volume Rendering Visualisation Lecture 10 Taku Komura Institute for Perception, Action & Behaviour School of Informatics Volume Rendering 1 Previously... contour or image rendering in 2D 2D Contour line

### CPSC GLOBAL ILLUMINATION

CPSC 314 21 GLOBAL ILLUMINATION Textbook: 20 UGRAD.CS.UBC.CA/~CS314 Mikhail Bessmeltsev ILLUMINATION MODELS/ALGORITHMS Local illumination - Fast Ignore real physics, approximate the look Interaction of

### Photon Mapping. Due: 3/24/05, 11:59 PM

CS224: Interactive Computer Graphics Photon Mapping Due: 3/24/05, 11:59 PM 1 Math Homework 20 Ray Tracing 20 Photon Emission 10 Russian Roulette 10 Caustics 15 Diffuse interreflection 15 Soft Shadows 10

### A Quick Introduction to POV-Ray

A Quick Introduction to POV-Ray POV-Ray, the Persistence of Vision ray tracer, is open source software available from www.povray.org. This is good, highly functional software that you might enjoy playing

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

Local Illumination CMPT 361 Introduction to Computer Graphics Torsten Möller Graphics Pipeline Hardware Modelling Transform Visibility Illumination + Shading Perception, Interaction Color Texture/ Realism

### Recursion and Data Structures in Computer Graphics. Ray Tracing

Recursion and Data Structures in Computer Graphics Ray Tracing 1 Forward Ray Tracing imagine that you take a picture of a room using a camera exactly what is the camera sensing? light reflected from the

### Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

Global Illumination CS334 Daniel G. Aliaga Department of Computer Science Purdue University Recall: Lighting and Shading Light sources Point light Models an omnidirectional light source (e.g., a bulb)

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Shading, Advanced Rendering Week 7, Wed Feb 28 http://www.ugrad.cs.ubc.ca/~cs314/vjan2007 Reading for Today and Tomorrow

### ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

ECS 175 COMPUTER GRAPHICS Ken Joy Winter 2014 Shading To be able to model shading, we simplify Uniform Media no scattering of light Opaque Objects No Interreflection Point Light Sources RGB Color (eliminating

### Project 1 Simple Ray Tracer

Project 1 Simple Ray Tracer CSE 168: Rendering Algorithms, Winter 2017 Description Write a simple ray tracer capable of rendering boxes and instances and outputting the image to a BMP file. It should support

### CS 130 Final. Fall 2015

CS 130 Final Fall 2015 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying

### CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture #6: Lights Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016 Announcements Thursday in class: midterm #1 Closed book Material

### COS 116 The Computational Universe Laboratory 10: Computer Graphics

COS 116 The Computational Universe Laboratory 10: Computer Graphics As mentioned in lecture, computer graphics has four major parts: imaging, rendering, modeling, and animation. In this lab you will learn

### Simple Lighting/Illumination Models

Simple Lighting/Illumination Models Scene rendered using direct lighting only Photograph Scene rendered using a physically-based global illumination model with manual tuning of colors (Frederic Drago and

### Lecture 8 Ray tracing Part 1: Basic concept Yong-Jin Liu.

Fundamentals of Computer Graphics Lecture 8 Ray tracing Part 1: Basic concept Yong-Jin Liu liuyongjin@tsinghua.edu.cn Material by S.M.Lea (UNC) Goals To set up the mathematics and algorithms to perform

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

Specular reflection Lighting II CS 465 Lecture 19 Smooth surfaces of pure materials have ideal specular reflection (said this before) Metals (conductors) and dielectrics (insulators) behave differently

### Graphics for VEs. Ruth Aylett

Graphics for VEs Ruth Aylett Overview VE Software Graphics for VEs The graphics pipeline Projections Lighting Shading VR software Two main types of software used: off-line authoring or modelling packages

### Introduction to Visualization and Computer Graphics

Introduction to Visualization and Computer Graphics DH2320, Fall 2015 Prof. Dr. Tino Weinkauf Introduction to Visualization and Computer Graphics Visibility Shading 3D Rendering Geometric Model Color Perspective

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

Computer Graphics Lecture 13 Global Illumination 1: Ray Tracing and Radiosity Taku Komura 1 Rendering techniques Can be classified as Local Illumination techniques Global Illumination techniques Local

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

Illumination Michael Kazhdan (601.457/657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2 Ray Casting Image RayCast(Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for

### A simple OpenGL animation Due: Wednesday, January 27 at 4pm

CMSC 23700 Winter 2010 Introduction to Computer Graphics Project 1 January 12 A simple OpenGL animation Due: Wednesday, January 27 at 4pm 1 Summary This project is the first part of a three-part project.

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

Foundations of omputer Graphics Online Lecture 10: Ray Tracing 2 Nuts and olts amera Ray asting Outline amera Ray asting (choose ray directions) Ravi Ramamoorthi Outline in ode Image Raytrace (amera cam,

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

Global Illumination Why Global Illumination Last lecture Basic rendering concepts Primitive-based rendering Today: Global illumination Ray Tracing, and Radiosity (Light-based rendering) What s Global Illumination