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

Similar documents
Photorealism: Ray Tracing

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

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

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

Assignment 6: Ray Tracing

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

Ray Tracing CSCI 4239/5239 Advanced Computer Graphics Spring 2018

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

Ray Tracer Due date: April 27, 2011

Assignment 2 Ray Tracing

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

Intro to Ray-Tracing & Ray-Surface Acceleration

CPSC GLOBAL ILLUMINATION

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

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

CS Simple Raytracer for students new to Rendering

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule

Raytracing CS148 AS3. Due :59pm PDT

Practical 2: Ray Tracing

Viewing and Ray Tracing. CS 4620 Lecture 4

Topics and things to know about them:

Viewing and Ray Tracing

Computer Graphics Ray Casting. Matthias Teschner

CS 4620 Midterm, March 21, 2017

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

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

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Lecture 11: Ray tracing (cont.)

Computer Graphics and Image Processing Ray Tracing I

Ray-Tracing. Misha Kazhdan

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Ray tracing Tutorial. Lukas Herzberger

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

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

CS 184: Assignment 4 Simple Raytracer

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

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

CS 325 Computer Graphics

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

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

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

Ray Tracing. Kjetil Babington

Ray Casting. To Do. Outline. Outline in Code. Foundations of Computer Graphics (Spring 2012) Heckbert s Business Card Ray Tracer

Acceleration Data Structures

6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, :05-12pm Two hand-written sheet of notes (4 pages) allowed 1 SSD [ /17]

Project 1 Simple Ray Tracer

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

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

Recursion and Data Structures in Computer Graphics. Ray Tracing

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

Ray Tracing COMP575/COMP770

Ray Casting. Outline in Code. Outline. Finding Ray Direction. Heckbert s Business Card Ray Tracer. Foundations of Computer Graphics (Fall 2012)

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Advanced Ray Tracing

Review for Ray-tracing Algorithm and Hardware

CMSC427 Final Practice v2 Fall 2017

Sung-Eui Yoon ( 윤성의 )

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

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

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

Raycasting. Chapter Raycasting foundations. When you look at an object, like the ball in the picture to the left, what do

03 RENDERING PART TWO

CS 465 Program 5: Ray II

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting

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

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.

Hidden Surface Elimination Raytracing. Pre-lecture business. Outline for today. Review Quiz. Image-Space vs. Object-Space

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Ray Tracing. Outline. Ray Tracing: History

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

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

Shadows. COMP 575/770 Spring 2013

Ray tracing. EECS 487 March 19,

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Ray Tracing. CPSC 453 Fall 2018 Sonny Chan

Raycast Rendering Maya 2013

Particle systems, collision detection, and ray tracing. Computer Graphics CSE 167 Lecture 17

Introduction to Ray-tracing Objectives

Lecture 11. More Ray Casting/Tracing

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

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

Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th

CS 4620 Program 4: Ray II

Raytracing. COSC 4328/5327 Scott A. King

EDAN30 Photorealistic Computer Graphics. Seminar 1, Whitted Ray Tracing (And then some!) Magnus Andersson, PhD student

INFOGR Computer Graphics

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Ray-tracing Acceleration. Acceleration Data Structures for Ray Tracing. Shadows. Shadows & Light Sources. Antialiasing Supersampling.

DH2323 DGI13. Lab 2 Raytracing

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

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

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Ray-tracing Cont. Ray-tracing

Agenda. Ray(tracing(algorithm( Code(structure( Ray(intersec;ons Sphere Triangle Hints Transforma;ons Debugging How(to(start

Photorealistic 3D Rendering for VW in Mobile Devices

1999, Denis Zorin. Ray tracing

Transcription:

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 Java, C++, C# No slow interpreted or scripting languages (Smalltalk, Eiffel, Python, etc.) Turn-in of assignments by demonstration to teaching assistant raytrace() { construct scene representation for each pixel ray = computeprimary() hit = first intersection with scene color = shade( hit ) set pixel color } Topics Generate camera rays Intersection routines for spheres, planes, triangles Meshes, instancing i Phenomenological shading Shadows Reflection Hacker s bonus: refraction Due date: in 3 weeks Start now! 1st week Set up programming environment Camera rays Intersection with planes Image output 2nd week Intersection with spheres, triangles, meshes Phong shading 3rd week Instancing, shadows, reflection Hacker s bonus (refraction, multithreading) A horizontal plane! Shading, shadows Mirrors Meshes, instancing Bonus: refraction 1

Useful Java libraries Matrix and vector math For example javax.vecmath.* Image input/output For example java.awt.image.*, in particular class BufferedImage Useful C++ libraries Boost libraries, http://www.boost.org/ Includes libraries for matrix math, image i/o, and many more Data structures class Ray class Camera class Material class HitRecord interface Intersectable class Sphere e class Triangle class Plane abstract class Aggregate class Mesh class IntersectableList Class Integrator class Film class Tonemapper Data structures class Ray class Camera class Material class HitRecord interface Intersectable class Sphere e class Triangle class Plane abstract class Aggregate class Mesh class IntersectableList Class Integrator class Film class Tonemapper Don t worry about object oriented design too much. Keep it simple! Ray tracing pseudo code Main loop construct scene; reference whole scene by one Intersectable construct lights construct integrator construct camera construct film for all pixels { ray = camera.makeray(pixel) spectrum = integrator.integrate(scene, lights, ray) film.set(pixel, spectrum) } film.writetofile Ray Origin, direction Origin Direction 2

Camera & image specification Parameters: eye position, look-at point, up vector, vertical field of view, aspect ratio, width in pixels, height in pixels Make primary rays given pixel coordinates Hit record Stores information about a ray-surface intersection Position Normal Ray direction Ray parameter at intersection Reference to material Material Stores material properties, information for shading More later Integrator Main methodintegrate Computes color for a ray Implements core ray tracing algorithm Different integrators can use different algorithms Simple integrator for debugging Shading without shadows Recursive ray tracing Path tracing Etc. Binary Integrator For testing, debugging integrate(scene, lights, ray) if(scene.intersect(ray)!= null) return white else return black Integrator with light sources If something is hit, sum over all light sources integrate(scene, lights, ray) hitrecord = scene.intersect(ray) if( hitrecord!= null ) spectrum = black for all light sources spectrum += contribution of light source return spectrum else return black 3

Intersectable Interface implemented by anything that can be intersected with a ray Methods intersect t (get surface area) (get bounding box) Spheres and planes Implement interface Intersectable Sphere: center, radius Plane: distance to origin, normal Intersection methods as discussed in next class Ray-plane intersection http://www.siggraph.org/education/materials/hypergraph/raytrace/rayplane_intersection.htm Ray-sphere intersection http://www.siggraph.org/education/materials/hypergraph/raytrace/rtinter1.htm Aggregate Abstract class that stores a collection of intersectables Intersecting an aggregate returns the closest hit A scene is represented by a single aggregate IntersectableList Simplest implementation of an aggregate A list of Intersectable intersect method traverses list, reports closest hit Mesh Implements Aggregate Stores a collection of triangles Array of vertex positions Array of vertex normals Array of indices, stores indices of three triangle vertices in position, normal arrays Mesh intersection Maintain a bounding volume for the mesh Sphere, axis aligned box If no intersection with bounding volume, return Else, iterate over all triangles Intersect each triangle Retain closest hit, i.e., smallest t parameter of ray Return closest hit 4

Triangle Stores reference to mesh Contains index into index array of mesh Looks up vertex data in arrays of mesh Implement interface Intersectable t Intersection method as discussed in next class Spectrum, Film, ToneMapper Spectrum Stores r,g,b values Film 2D array of spectra ToneMapper Writes Film to an image file Scene description Keep scene description in separate file to keep code clean See example files Next time Ray-surface intersection Shading Reflection, refraction, shadows 5