Project 3 Help Session: Ray Tracing. Getting Started Download the starter pack. 1.sample_ray.exe 2.ray-skel directory 3.scenes directory Look at the Road.

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

13.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 13 An Introduction to Ray Tracing.
Lecture 14 Illumination II – Global Models
Light Issues in Computer Graphics Presented by Saleema Amershi.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
CS 325 Introduction to Computer Graphics 04 / 09 / 2010 Instructor: Michael Eckmann.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
Reflection & Refraction of Light Reflection: specular (mirror) vs diffuse angle of incidence = angle of reflection Refraction: Snell’s Law n 1 sin 
Ray Tracing Outline For each pixel { Shoot ray r from eye to center of pixel with trace( r ) } function trace( r ) For each object { Find object with closest.
Ray Tracing Jerry Sui Adam Conner. Part I – Introduction to Ray Tracing Final Product.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
Ray Tracing 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 2: Basic Ray Tracing Ravi Ramamoorthi Some slides courtesy.
LIGHTING Part One - Theory based on Chapter 6. Lights in the real world Lights bounce off surfaces and reflect colors, scattering light in many directions.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
12/05/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling Very brief intro to global illumination.
Reflections Specular reflection is the perfect reflection of light from a surface. The law a reflection states that the direction of the incoming ray and.
Project Raytracing. Content Goals Idea of Raytracing Ray Casting – Therory – Practice Raytracing – Theory – Light model – Practice Output images Conclusion.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
College of Computer and Information Science, Northeastern UniversityOctober 18, CS5310 Graduate Computer Graphics Prof. Harriet Fell Spring 2011.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Ray Tracing.
1 Dr. Scott Schaefer Ray Tracing. 2/42 Ray Tracing Provides rendering method with  Refraction/Transparent surfaces  Reflective surfaces  Shadows.
Week 10 - Wednesday.  What did we talk about last time?  Shadow volumes and shadow mapping  Ambient occlusion.
Ray Tracer Winter 2014 Help Session Due: Tuesday, Feb 25 th, 11:59pm TA: Will Gannon.
1 Ray-Tracing ©Anthony Steed Overview n Recursive Ray Tracing n Shadow Feelers n Snell’s Law for Refraction n When to stop!
Ray Tracing TP OpenGL PHAM Trong Tôn WANG Yuanhang.
Reflection and Light Flat Mirrors.
Ray Tracer Spring 2008 Help Session. Outline Project Web Resources What do you have to do for this project? Ray Class Isect Class Requirements Tricks.
Alex YAU Important Notes Website for Assignment #2 You.
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
CS380: Computer Graphics Distributed Ray Tracing TA Course URL:
Ray-tracing.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
College of Computer and Information Science, Northeastern UniversityFebruary 3, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2006.
CSE 681 Introduction to Ray Tracing. CSE 681 Ray Tracing Shoot a ray through each pixel; Find first object intersected by ray. Image plane Eye Compute.
CS 325 Introduction to Computer Graphics 04 / 07 / 2010 Instructor: Michael Eckmann.
Light. Intensity calculation = wavelength I( ) = wavelength intensity of light reaching eye I( ) = I diff ( ) + I spec ( ) + I refl ( ) + I trans ( )
CS552: Computer Graphics Lecture 36: Ray Tracing.
Review Ray Tracing III Review. Pseudo codes RayCast-1  Plain ray caster (direct illumination) RayCast-2  RayCast-1 + shadow rays RayTrace-1  Recursive.
Ray Tracer Help Session. Outline Introduction ray vec.h and mat.h isect Requirements Tips and Tricks Memory Leaks Artifact Requirement Ray Tracing Surface.
Introduction to Ray Tracing Dr. B. Raghu Professor /CSE Sri Ramanujar Engineering College.
Ray Tracer Help Session.
Advanced Computer Graphics
Photorealistic Rendering vs. Interactive 3D Graphics
Ray Tracer Spring 2007 Help Session.
Unit-7 Lighting and Shading
Autumn 2010 Help Session Christopher Raastad
© University of Wisconsin, CS559 Fall 2004
Prof. Harriet Fell Fall 2011 Lecture 24 – November 2, 2011
Ray Tracer Project CSE 557.
Ray Tracing.
Fundamentals of Computer Graphics Part 6 Shading
Reflection and Light Flat Mirrors.
Reflection and Refraction
14th Lecture – Final Lecture
Ray Tracer Spring 2004 Help Session.
GR2 Advanced Computer Graphics AGR
Ray Tracer Project CSE 557.
Ray Tracer Spring 2008 Help Session.
Reflection and Refraction
Simple Texture Mapping
Reflection and Refraction
Introduction to Ray Tracing
Ray Tracer Autumn 2005 Help Session.
Ray Tracer Spring 2006 Help Session.
Presentation transcript:

Project 3 Help Session: Ray Tracing

Getting Started Download the starter pack. 1.sample_ray.exe 2.ray-skel directory 3.scenes directory Look at the Road MapRoad Map Try tracing some scenes with sample_ray.exe

Scenes Examples (in scenes/simple/)Examples Syntax (and how to extend the parser)Syntax

Materials emissive: ke, the emissive color. ambient: ka, the ambient color. specular: ks, the specular color. reflective: kr, the reflective color. Defaults to ks if not specified. diffuse: kd, the diffuse color. transmissive: kt, the ability for this material to transmit light in each channel (as a 3-tuple). shininess: ns, the shininess (between 0 and 1). index: the material's index of refraction.

Casting Rays Two steps: 1.Create the ray. ray r( Vec3d(0,0,0), Vec3d(0,0,0),ray::VISIBILITY ); 2.Then cast it by calling traceRay(r). isect i; // an intersection object. if( scene->intersect( r, i ) ) { // There was an intersection with an object in the scene. // Do something with i. (Perhaps cast more rays from the point // of intersection. }else{ // There is no intersection, the ray is shot into the black void of space. }

ray Class ray r (start position, direction, RayType) enum RayType{VISIBILITY, REFLECTION, REFRACTION, SHADOW}; r.at(t), a method that determines the position of the ray r as a function of t, the distance from the start position.

isect Class An isect represents the location where a ray intersects a specific object. Important member variables: const SceneObject *obj; // the object that was intersected. double t; // the distance along the ray where it occurred. Vec3d N; // the normal to the surface where it occurred Vec2d uvCoordinates; // texture coordinates on the surface. [1.0,1.0] Material *material; // non-NULL if exists a unique material for this intersect. const Material &getMaterial() const; // return the material to use *red ones are important

The Skeleton Code Intersection for boxes and spheres is missing. (Box::intersectLocal()) Implement the Phong shading model. (Material::shade()) Implement recursive ray tracing! This includes Shadow Attenuation, Reflection, Refraction, and Antialiasing. ( RayTracer::traceRay())

intersectLocal() The ray and object are transformed back to the origin. Only write intersect code for the geometry in canonical form! (i.e. the unit sphere and the box extending 0.5 in all directions.)

The Complexities of Refraction Indices of refractionIndices Remember Snell’s Law?Snell’s Law How can you use the normal to determine whether you are entering or exiting?? n air = n glass =1.5

RAY_EPSILON To avoid round-off error, add RAY_EPSILON (=0.0001) to the start position of rays fired from points of intersection. given isect i and ray r: new_position = r.at(i.t + RAY_EPSILON) RAY_EPSILON