Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
01 - Introduction and Overview
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Who Am I?• Assistant Professor of Computer Science since February 2016
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Graphics @ Courant
Denis Zorin Kenneth Perlin Daniele Panozzo
Geometry ProcessingDigital Fabrication
Architectural Geometry
Virtual RealityComputer/Human Interface
Animation
Fluid and Solid SimulationMicrostructures
Scientific Computing
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
What is Computer Graphics?
• In a broad sense is the use of a computer to create and manipulate images
• It involves a combination of hardware (input, processing, output) and software
• It can be 2D or 3D
• It is used in most electronic devices
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Graphic Areas
Modelinghttps://www.youtube.com/watch?v=Udno6EA5lXY
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Graphic Areas
Rendering
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Graphic Areas
Animation
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Graphic Areas
User Interaction
Copyright: Andrew Guyton
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Graphic Areas
Virtual Reality
Copyright: Maurizio Pesce
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Graphic Areas
Visualization
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Graphic Areas
Image ProcessingBy IkamusumeFan - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=41790217
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Graphic Areas
Geometry Acquisition
By Creative Tools from Halmdstad, Sweden - CreativeTools.se - VIUscan - Laser-scanned - ZPrinter - 3D printed - Viking Belt Buckle 24, CC BY 2.0, https://commons.wikimedia.org/w/index.php?curid=12419129
http://www.agisoft.com
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Applications
Video Games
Copyright: Nintendo
Cartoons/Visual Effects/Films
Copyright: Blender Foundation
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Applications
CAD/CAM Simulation
By Andreas Babucke - self made with EAS3, original upload at http://de.wikipedia.org/wiki/Bild:Lambda2_scherschicht.png, CC BY 3.0 de, https://commons.wikimedia.org/w/
index.php?curid=2999003
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
ApplicationsMedical Imaging Information Visualization
By Etan J. Tal - Own work, CC BY 3.0, https://commons.wikimedia.org/w/index.php?
curid=12743250
By Mcstol - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=18553353
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Two major approachesPer-pixel - “Raytracing”
By Henrik - Own work, GFDL, https://commons.wikimedia.org/w/index.php?curid=3869326
Per-object - “Rasterization”
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Per-pixel
By Henrik - Own work, GFDL, https://commons.wikimedia.org/w/index.php?curid=3869326
• Easy to parallelize but hard to map to hardware
• Expensive!
• It can be extended to model many physical phenomena such as internal scattering, diffraction, reflections, etc.
• Used to obtain high quality images
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Per-object
• Easy to map to hardware
• While it cannot model directly complex effects, we can approximate them
• Used in interactive applications (mostly)
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Course Goals
• Study the fundamental mathematical concepts used in image synthesis algorithms
• Implement a basic rendering system based on ray tracing
• Implement two interactive applications based on object-order rendering (rasterization), one in 2D and one in 3D
• Apply these techniques in a final coding project
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Final Coding Project
• Individual project, we will publish the rules later but you are essentially free to do whatever you want, as long as it requires computer graphics
• The project will be presented in a fast-forward session at the end of semester (3-5 minutes per project)
• The winner will be awarded with a paid trip to SIGGRAPH!
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
SIGGRAPH
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Prerequisites• Linear Algebra
• We will quickly review the concepts that you need, if you are not familiar with basis, points, vectors, matrices and linear systems, please review it on the textbook (Chapter 2, 5)
• C++
• We will review the basic concepts of C++ next week, comparing them with Java. Keep this reference at hand http://www.cppreference.com
• Why C++?
• Git
• It will be used to distribute material and to deliver homework
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Organization
• Communication through the course repository/website: https://github.com/danielepanozzo/cg
• Mailing list (if you did not receive the test email, let me know)
• Weekly lecture: Mondays 7.10-9 PM
• Office hours
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Lectures
• I will upload the slides on the website before the class, so that you can directly annotate them
• For every class, I will always add references in the end to the textbook and/or external resources
• At the end of every lecture, I will quickly introduce the topic of the next lecture and give you pointers — you are encouraged to take a look at the material before I present it in class
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Lectures
• Please interrupt me at any time to ask questions
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Material
Fundamentals of Computer Graphics, Fourth Edition 4th Edition by Steve Marschner, Peter Shirley
https://open.gl
https://www.wikipedia.org
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
GradingAssignment Topic Grade
1 Ray Tracing 17.52 Raster 2D 17.53 Raster 3D 17.54 Final Project 27.5
Total Exercises: 80%• Final Oral Exam: 20% (you must get at least 10% in the final to pass)
• You must pass the final to pass the class
• The oral exam will be video recorded (if you don’t want to be recorded send me a private email before the end of the week)
• There will be optional tasks, that will allow you to recover points lost in the assignments
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Policy
• You are encouraged to consult with your classmates/friends but collaboration in the assignments is NOT allowed
• You are not allowed to copy code online or use external libraries (except those provided in the class) for the first 3 assignments
• We will use plagiarism tools to validate all homework
• I am horrible with names but I would still like to make an effort, please help me :)
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Break
• What do you prefer?
• Let me know after this 10 minutes break!
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Basic Math• Sets
• Functions/Maps
• Intervals
• Logarithm
• Solving Quadratic Equations
• Trigonometry
• Basic Linear Algebra
If you are not familiar with some of these topics, refresh them before the next class.
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Images
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Images
By The original uploader was Darth Stabro at English Wikipedia - Transferred from en.wikipedia to Commons by Pbroks13 using CommonsHelper., CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=15789788
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Raster Devices
• Output
• 2D: Display (LCD,LED)
• 1D: Hardcopy (ink-jet, dye sublimation)
• Input
• 2D Array: digital camera
• 1D Array: scanner
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Bayesian Color-Filter
By en:User:Cburnett - Own workThis vector image was created with Inkscape., CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=1496858
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Pixel Coordinates - Raster Image
0,0
x=-0.5y=-0.5
0,3
3,0
Be Careful: Y is flipped
in some APIs
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Pixel Values (Framebuffer format)
• 1-bit greyscale - text
• 8-bit RGB (24 bits) - web and email
• 8-bit RGBA (32 bits) - alpha channel, see next slide
• 16/24/32bits - high accuracy for photography and HDR
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Monitors Intensity, Gamma Correction
• What is the minimal and maximal light intensity?
• The intermediate intensities are different for each person, and it is non-linear
• Monitors needs to be calibrated for a certain viewer, using a procedure called “Gamma Correction”
• The rule is simple: displayed intensity = (max intensity) * a�
Pixel Value
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Gamma Correction
• Find the neutral gray:
• Compute
• The colors will not be uniform on normal screens, one of the major factor affecting the cost of screens is their ability to be consistent on all pixels!
By X-romix 10:00, 7 June 2008 (UTC), Updated by --Rubybrian (talk) 14:25, 14 September 2010 (UTC); Photographer: Toni Frissell - This file was derived from: Weeki Wachee spring 10079u.jpg, GFDL, https://commons.wikimedia.org/w/index.php?curid=4176109
0.5 = a�
� =ln 0.5
ln a
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
RGB vs CMYK colors• RGB is additive • CMYK is subtractive
By BenRG and cmglee - http://commons.wikimedia.org/wiki/File:CIE1931xy_blank.svg, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=32158329
Calibration is very important!
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Alpha Compositing
• A way to represent transparency
• The pixels of an image are blended linearly with the image below
• c = ↵cnew + (1� ↵)cold
↵ = 1
↵ = 0
RGBA is very common, and you will use it often!
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Image Formats• Lossy:
• jpeg - compact, introduces artifacts
• Lossless:
• png - common for web applications
• ppm - very simple, not compressed
• tiff - mostly scientific use
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
References
Fundamentals of Computer Graphics, Fourth Edition 4th Edition by Steve Marschner, Peter Shirley
Chapters 1,2,3