Lecture - 1
Lecture - 1
Lecture – 1
Introduction
1
Outline
• What is CG
• CG Areas
• Major Applications
• Graphics API
2
What is CG? (1/1)
• The term computer graphics describes any use
of computers to create and manipulate
images.
– Graphics can be 2D or 3D
– Images can be completely synthetic or can be
produced by manipulating photographs.
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
3
CG Areas (1/4)
• Modeling:
– deals with the mathematical specification:
• shape and appearance properties in a way that
can be stored on the computer.
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
4
CG Areas: Metaphor
Source:
https://youtu.be/6Sv4oXSTAms
5
CG Areas (2/4)
• Modeling: Example –
• an object can be described as 3D
coordinates:
[0, 0, 3], [0, 3, 3], [0, 3, 0], [0, 0, 0],
[3, 0, 3], [ 3, 3, 3], [3, 3, 0], [3, 0, 0]
• connect the points
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
6
CG Areas (3/4)
• Rendering:
– a term inherited from art
– deals with the creation of shaded images from 3D
computer models.
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
7
CG Areas (4/4)
• Animation:
– creates an illusion of motion through sequences
of images.
– uses modeling and rendering but adds movement
over time
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
8
Major Applications (1/12)
• Video games
• Cartoons
• Visual effects
• Animated films
• CAD/CAM
• Simulation
• Mixed Reality
• Information visualization
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
9
Major Applications (2/12)
Games (2D)
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
10
Major Applications (3/12)
Games (3D)
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
11
Major Applications (4/12)
Movies (VFX)
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
12
Major Applications (5/12)
Movies (Animated)
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
13
Major Applications (6/12)
Mixed Reality
Source: https://media-cldnry.s-nbcnews.com/image/upload/newscms/2018_11/2362571/180314-virtual-reality-headset-ew-1243p.jpg
https://images.theconversation.com/files/245627/original/file-20181114-194494-1p82jkx.jpg?ixlib=rb-1.1.0&q=45&auto=format&w=1200&h=1200.0&fit=crop 14
Major Applications (7/12)
Google Maps
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
15
Major Applications (8/12)
Source: https://youtu.be/eJy5dHMY-S4
16
Major Applications (9/12)
Word Cloud
17
Major Applications (9/12)
18
Major Applications (10/12)
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
19
Major Applications (11/12)
Simulation
Source: https://www.aircharterservice.com/about-us/news-features/blog/are-vr-flight-simulators-the-future-of-pilot-training
20
Major Applications (12/12)
Simulation
Source: https://www.financialexpress.com/sports/what-is-drs-all-the-the-rules-number-of-chances-and-components-explained/578996/
21
Graphics API (1/2)
• A graphics API is a set of functions that
perform basic operations such as –
– drawing images and 3D surfaces into windows
on 2D screen.
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
22
Graphics API (2/2)
Every graphics program needs to be able to use two related APIs
– Graphics API for visual output.
• Ex:
– i.e. command for drawing lines, circles etc.
– User-interface API to get input from the user.
• Ex:
– Windows API (WinAPI), UIKit, Android SDK etc.
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
23
Graphics Pipeline (1/9)
• Special software/hardware subsystem that maps the 3D vertex
locations to 2D screen.
• From modeling to rendering.
– Shade the triangles –
• Realistic
• Proper back-to-front order.
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
24
Graphics Pipeline (2/9)
Vertex Data []
Step 1: Vertex shader takes vertex data (position, texture coordinates, normals) as
input and transform it
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
25
Graphics Pipeline (3/9)
Vertex Data []
Step 2: Shape assembly gets the transformed vertices and group them into
geometric primitives
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
26
Graphics Pipeline (4/9)
Vertex Data []
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
27
Graphics Pipeline (5/9)
Vertex Data []
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
28
Graphics Pipeline (6/9)
Vertex Data []
Step 5: Some additional operations such as depth testing (to determine visibility)
and blending are performed at the final step.
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
29
Graphics Pipeline (7/9)
• Why triangles?
– It is the simplest universal surface element
– it is the convex hull of three points.
• A line or a point are even simpler, but do not create
surfaces.
• it isn't possible to use only a finite number of them without
having cracks.
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
30
Graphics Pipeline (8/9)
• Mesh:
A polygon mesh is a collection of vertices, edges and faces
that defines the shape of a polyhedral object.
– Ex. Quad mesh, Triangle mesh.
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/ |
https://en.wikipedia.org/wiki/Triangle_mesh
26
Graphics Pipeline (9/9)
.obj file
Source:
https://www.sculpteo.com/en/glossary/obj-file-3d-printing-file-format/
32
LoD (1/3)
• Rendering speed ↔ number of triangles being drawn
• More triangles: more storage. [0, 0, 3], [0, 3, 3], [0, 3, 0], [0, 0, 0],
[3, 0, 3], [ 3, 3, 3], [3, 3, 0], [3, 0, 0]
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/ |
https://en.wikipedia.org/wiki/Triangle_mesh
26
LoD (2/3)
• Example of LoD:
Credit: Fundamentals of Computer Graphics 3rd Edition by Peter Shirley, Steve Marschner | http://www.cs.cornell.edu/courses/cs4620/2019fa/
Source: https://developer.nvidia.com/gpugems/gpugems2/part-i-geometric-complexity/chapter-2-terrain-rendering-using-gpu-based-geometry
34
LoD (3/3)
35
Source:The Last of Us Part 1
Further Reading
• Fundamentals of Computer Graphics, 4th Edition - Chapter 1
• Real-Time Rendering, Fourth Edition - Section 19.9
36
Thank You
37