CS 410: Computer Graphics Professor: Bruce Draper Room 440 CSB (970) 491-7873 Office Hours: Mon 10:00 11:00 Tues 10:00 11:00 or by appointment draper@cs.colostate.edu 1-slide Overview This is what you will learn to make Teaching Assistant : Quanyi Mo Office Hours: TBD cs410@cs.colostate.edu Charumathi Chandrasekaran Ben Randall But you will have to work hard to get there Web Site: http://www.cs.colostate.edu/~cs410 Another Example Fall 2012 2 In This Class What can you say about this image? You will build a ray tracer. Input In other words, what processes are at work simulated to create what you are seeing? Scene model (objects, surfaces & materials) Lighting models Camera models Output An image showing what the camera would see. 3 What we will do. In the Process Program a ray tracer from scratch General flow of programming assignments Study computational geometry 1. 2. 3. 4. Dot (i.e. inner) products (of vectors) Cross products (of vectors) Homogeneous coordinates Affine & perspective transformations Matrix multiplication Orthonormal matrices Simple ray casting with global geometry Geometric generality relative placement Illumination and surface reflectance Multi-bounce tracing with reflection/refraction Each assignment builds on the one before 20 30 hours each 4 Expertise of value beyond Graphics! Following good software practices 5 6
3-D geometric intuition and of course also Expertise requires three things. Linear algebra objects and operations Visual intuition seeing what your specifying Quick and easy shifting back and forth Most obvious examples. Move the camera back a bit Place object A on top of object B. Learn about light Color spaces Reflection & refraction Surface properties Lambertian (Matte) reflection Specular reflection Hybrid reflection models 7 8 Resources (1) Resources Public Website Lectures very important General concepts Illustrative Examples Textbook reference Details generally presented in a clear exposition. 9 10 Resources (3) Private Website Canvas Used for grade distribution Office hours Mine: M/T 10:00-11:00 Mo s: TBD (not his fault) Don t be a stranger! More about the Textbook Adopted in 2011 at CSU Virtues Up-to-date Focuses on Ray Tracing Consistent terminology Well staged mathematics Downside Expensive There is an electronic version ISBN 978-1-56881-469-8 11 12
Course Rules Be on time Class starts at 3:30 Ask & Answer questions Always give your name in the process Professional behavior at all times No non-course related chatter Cell phones on silent Leave the room to answer them Be polite & respect others 13 Major Activities / Grading Term Paper (this is a CS Capstone Course) 10% of your grade Programming Projects (4) 45% of your grade total 11.25% each Midterms (2) 25% of your grade (total) 12.5% of your grade (each) Final exam 20% of your grade 14 Policies Systems and Tools Assigned work is done alone No joint projects No open note exams No taking code from the internet Follow the department academic integrity policy All work done on time No late period deadlines are deadlines When given two (or three) weeks, start right away! Exceptions: unforeseeable circumstances You may be surprised You will not learn a complex and/or arcane API to a giant graph package. Instead, you will build your ray tracer from scratch in C++ or Java Applying programming techniques from CS253 and CS314. 15 16 This course is NOT Systems - Requirements A course in OpenGL OpenGL shaders are complex & detailed Ray Tracing is about to become the dominant paradigm Thanks to GPUs and parallel architectures A course in using any other Graphics API Mechanics Must run on CS Linux Machines Tools for viewing models will be provided Tools for viewing images will be provided This is a course about the mathematics and algorithms underlying Ray Tracing. It should make you a better programmer, improve your linear algebra, and prepare you to study computer vision (which is where the jobs are ) 17 18
Into The Substance What is an image? Now Image formation Let us walk quickly through some of the key concepts of this course as a means of setting up a context for what is to come. 20 What is an image? (cont) How is an image formed? An array of values Intensities (if gray scale) Triples of red, green & blue (color) This image is a part of the previous image Where? 21 22 Step 1: Light Source Step 2: Reflection Lights Sources have Intensities Color Positions Bonus: atmospheric effects 23 24
Step 3: Projection How (artificial) images are formed Light Source Coordinate System Sensor Geometric Objects 25 26 Now mimic light or From source to object to sensor 27 from source to object to object to sensor 28 or True But Backwards! Light sources emit a LOT of light rays Most of them never strike your camera And you might have multiple light sources In fact, you usually do, and the light intermingles So following every light ray is expensive you get the point. 29 So instead, work backwards: start at the surface of the lens, and figure out where the light came from all the way back to the light source. 30
What can this approach do? In other words A photorealistic rendered image created by using POV-Ray 3.6 Image from Wikipedia entry on rendering. 31 What skills will we need? 33 Familiarity with vectors and matrices Mechanics, e.g. multiplication Basic ideas (perhaps rusty) Programming ability You know how to design, implement & test thousand line plus programs Test-first development Design patterns Object-oriented designs Willingness to work (hard) Quick Who Does What? Term Paper I will describe graphics principles Capstone courses integrate material from throughout the CS curriculum Describe how a programming methodology/ technique learned in CS314 or CS253 was applied in building your ray tracer (2 pages) Mathematics (e.g. projection) Physics (e.g. reflections) I will describe some algorithms E.g. ray/polygon intersection 34 Candidates include: We will discuss/practice concepts. You will convert ideas into code. 32 What do I expect? Lots of Math Linear Algebra (Matrices, Vectors, Dot Products) Discrete representations (Images) A little Physics Lighting/Energy Transfer Color reflections/refraction A little Mechanical Engineering CAD/CAM, Solid Models A whole bunch of Computer Science Test-first development Design patterns Systematic memory management (C++ programs only) 35 36
Term Paper II Term Paper : Due Tuesday Describe how a software tool was applied when building your ray tracer (1 page) Candidate tools include: Testing frameworks Version management tools Profiling tools Tools introduced before CS253 (e.g. compilers, GUIs) do not count. One week from today: Two sentences: Which methodology/technique will you write about? Which tool will you write about? I will approve or reject them If rejected, do it again Note: you will be held to your choice of topics in December, when the paper is due! 37 38