introduction and overviewcseweb.ucsd.edu/classes/wi20/cse167-a/lec1.pdf · sketchup cse 167, winter...
TRANSCRIPT
Overview
Computer Graphics
CSE 167
Lecture 1
CSE 167: Computer Graphics
• Today
– Course overview
– Logistics
CSE 167, Winter 2020 2
What is computer graphics?
• Everything visual on computers• The representation and manipulation of image
data by a computer• The various technologies used to create and
manipulate images• The methods for synthesizing and manipulating
visual content using a computer• The manipulation of visual and geometric
information using computational techniques that focus on the mathematical and computational foundations of image generation and processing
CSE 167, Winter 2020 3
History
• 1940s: Modern digital computers
• 1950s: High-level programming languages and the integrated circuit
• 1950s: Introduction of the cathode ray tube (CRT) as a viable computer display
• 1960s: Operating systems
• 1960: The phrase “computer graphics” is coined
• 1970s: Microprocessor
• 1980s: Personal computers (PCs)
CSE 167, Winter 2020 4
History
• 1949: Manchester Mark 1
CSE 167, Winter 2020 5
Display
History
• 1963: Sketchpad
– First interactive graphics system
https://www.youtube.com/watch?v=495nCzxM9PI
CSE 167, Winter 2020 6
History
• c. 1975: Graphical user interface (GUI)
– Xerox Palo Alto Research Center (PARC)
CSE 167, Winter 2020 7Xerox Alto (1976) Microsoft Windows 1.01 (1985)
History
• History of computer animation (20 min)
https://www.youtube.com/watch?v=LzZwiLUVaKg
https://www.youtube.com/watch?v=S3hqS6JlKEc
CSE 167, Winter 2020 8
Rendering: 1960s (visibility)• Roberts (1963), Appel (1967): hidden line algorithms
• Warnock (1969), Watkins (1970): hidden surface
• Sutherland (1974): visibility = sorting
CSE 167, Winter 2020 9Images from FvDFH, Pixar’s ShutterbugSlide ideas for history of Rendering courtesy Marc Levoy
Rendering: 1970s (raster graphics, lighting)• Gouraud (1971): diffuse lighting, Phong (1974): specular lighting
• Blinn (1974): curved surfaces, texture
• Catmull (1974): Z-buffer hidden surface algorithm
CSE 167, Winter 2020 10
Rendering: 1980s and 90s (global Illumination)
• Whitted (1980): ray tracing
• Goral, Torrance, et al. (1984): radiosity
• Kajiya (1986): the rendering equation
CSE 167, Winter 2020 11
Modern applications
• Movies
• Video games
• Computer aided design
• Visualization
• Virtual reality
• Augmented reality
• Mixed reality
CSE 167, Winter 2020 12
Entertainment
Movies: Brave, Pixar 2012CSE 167, Winter 2020 13
Entertainment
Games: Halo 3, Bungie 2007 CSE 167, Winter 2020 14
Lighting simulation
Interior Design
Automobile Visualization
CSE 167, Winter 2020 15
Computer aided design
Interiors Professional
Mechanical CADArchitectural CADElectronics CADCasual Users
Sketchup
CSE 167, Winter 2020 16
Visualization: science and medicine
CSE 167, Winter 2020 17
Visible Human Project: University of Hamburg
Virtual reality
• VR for design and entertainment
• Simulators: surgical, flight, driving, spacecraft
CSE 167, Winter 2020 18
Major computer graphics areas
CSE 167, Winter 2020 19
Modeling Animation Rendering
• The mathematical specification of shape and appearance properties
• Basic 3D models consist of arrays of triangles
• Models are created with 3D modeling tools or constructed from 3D scans
• Models can be procedurally generated (e.g., curves)
Modeling
CSE 167, Winter 2020 20
Procedural tree
Animation
• A technique to create an illusion of motion through a sequence of images
• Keyframing
– Manually animate key frames
– Inbetweening is performed automatically using interpolation
• Motion capture
CSE 167, Winter 2020 21
Rendering
• The creation of shaded images from 3D computer models
• Photorealistic rendering– Physics-based simulation of light– Slow (minutes or hours to render an image)– Used in movies
• Interactive rendering– Often “as photorealistic as possible”– Fast (within milliseconds to render an image)– Used in games
CSE 167, Winter 2020 22
Why study 3D computer graphics?
• Applications • Fundamental intellectual challenges
– Create and interact with realistic virtual world– Requires understanding of all aspects of physical
world– New computing methods, displays, and technologies
• Technical challenges– Math of (perspective) projections, curves, and
surfaces– Physics of lighting and shading– 3D graphics software programming and hardware
CSE 167, Winter 2020 23
CSE 167 topics
• Vectors, matrices, and linear algebra• Geometric primitives (e.g., points)• Geometric transformations• Coordinate frames• Projection and viewing• Rasterization• Surface shading• Textures• Curves• Ray tracing
CSE 167, Winter 2020 24
Geometric primitives
• Points• Line segments (and chains of connected line segments)• Triangles• And that’s all!
– Curves• Approximate them with chains of line segments
– Polygons• Break them up into triangles
– Curved surfaces• Approximate them with triangles
• Trend over the decades towards minimal primitives– Simple, uniform, repetitive = good for parallelism
CSE 167, Winter 2020 25
Transformations, coordinate frames, projection, and viewing
ModelTransformation M
ViewTransformation V
Object (or Model) Coordinate Frame
World Coordinate Frame
Camera (or Eye) Coordinate Frame
ProjectionTransformation P
Normalized Device Coordinate Frame
ViewportTransformation D
Window (or Screen) Coordinate Frame
World coordinate frame
Object (or model)coordinate frame
Camera (or eye)coordinate frame
View frustum in camera (or eye)
coordinate frame
Canonical view volume in normalized device coordinate frame
(x0, y0)
(x1, y1)
x
y
window
viewport
Window (or screen) coordinate frame
CSE 167, Winter 2020 26
Rasterization
• At each pixel, we need to
determine which triangle
is visible
CSE 167, Winter 2020 27
Local illumination
• Model reflection of light at surfaces
– Assumption: no subsurface scattering
• Bidirectional reflectance distribution function (BRDF)
– Given light direction, viewing direction, how much light is reflected towards the viewer
– For any pair of light/viewing directions!
CSE 167, Winter 2020 28
Local illumination
• Not a physics-based simulation
• Uses simplified models that reproduce perceptually most important effects
– One bounce of light
• Direct (from light source) illumination
– Indirect illumination with an “ambient” term
• Computationally very fast
• Used in interactive applications
CSE 167, Winter 2020 29
Surface normals
• Important to bring out 3D appearance
• Important for correct shading under lights
• The way shading is done also important
– Flat: Each facet has single normal
– Smooth: Each vertex has a single normal, interpolate normal vectors to determine normal at point on facet
Flat
SmoothCSE 167, Winter 2020 30
Large triangles
• Advantages
– Often sufficient for simple geometry
– Fast to render
• Disadvantages
– Per vertex colors look boring and computer-generated
CSE 167, Winter 2020 31
Texture mapping
• Map textures (images) onto surface polygons
• Same triangle count, much more realistic appearance
CSE 167, Winter 2020 32
APPLICATION
COMMAND STREAM
VERTEX PROCESSING
TRANSFORMED GEOMETRY
RASTERIZATION
FRAGMENTS
FRAGMENT PROCESSING
FRAMEBUFFER IMAGE
DISPLAY
You are here
3D transformations, shading
Conversion of primitives to pixels
Blending, compositing, shading
User sees this
Pipeline overview
CSE 167, Winter 2020 33
Programming hardware pipelines
• Modern hardware graphics pipelines are flexible– Programmer defines exactly what happens at each stage
– Do this by writing shader programs in domain-specific languages called shading languages
– Rasterization is fixed-function, as are some other operations (depth test, many data conversions, …)
• One example: OpenGL and GLSL (GL Shading Language)– Several types of shaders process primitives and vertices;
most basic is the vertex program
– After rasterization, fragments are processed by a fragment program
CSE 167, Winter 2020 34
Interactive rendering results
CSE 167, Winter 2020 35
Two approaches to rendering
for each object in the scene {for each pixel in the image {
if (object affects pixel) {do something
}}
}
object orderor
rasterization
image orderor
ray tracing
for each pixel in the image {for each object in the scene {
if (object affects pixel) {do something
}}
}
CSE 167, Winter 2020 36
Ray tracing algorithm
for each pixel {compute viewing rayintersect ray with scenecompute illumination at visible pointput result into image
}
CSE 167, Winter 2020 37
Photorealistic rendering results
CSE 167, Winter 2020 38
CSE 167 objectives
• Theory: mathematical aspects and algorithms underlying modern 3D graphics systems
• Systems: development of complex 3D graphics programs
• Note: although we will be using modern OpenGL (3.3 and later), this course is not about the specifics of 3D graphics programs and APIs like Maya, Alias, Direct3D, Vulkan, and Metal, but about the concepts underlying them
CSE 167, Winter 2020 39
Syllabus
• Instructor: Ben Ochoa• TAs: Ronald Baldonado, Yihang (Stacy) Cheng, and Xinming
(David) Zhang• Tutors: Guangyan (Nick) Cai, Kevin Huang, and Wenlin Mao• Course website
– https://cseweb.ucsd.edu/classes/wi20/cse167-a/
• 18 lecture meetings– 2 university holidays (Jan 20 and Feb 17)
• Homework discussion: Thursdays 8:00 PM-8:50 PM• Class discussion
– Piazza
CSE 167, Winter 2020 40
Syllabus
• Grading– 5 homework assignments (80% of grade)
• Significant amount of work, but rewarding
• Start early!
• Graded in person on Fridays, 1:00 PM-3:00 PM
• Late policy: 30% grade reduction– Will not be accepted 1 week after the due date
– Midterm exam (20% of grade)
– No final exam
– Piazza• Ask (and answer) questions using Piazza, not email
• Good participation could raise your grade (e.g., raise a B+ to an A-)
CSE 167, Winter 2020 41
Academic integrity policy
Integrity of scholarship is essential for an academic community. The University expects that both faculty and students will honor this principle and in so doing protect the validity of University intellectual work. For students, this means that all academic work will be done by the individual to whom it is assigned, without unauthorized aid of any kind.
CSE 167, Winter 2020 42
Collaboration policy
It is expected that you complete your academic assignments on your own and in your own words and code. The assignments have been developed by the instructor to facilitate your learning and to provide a method for fairly evaluating your knowledge and abilities (not the knowledge and abilities of others). So, to facilitate learning, you are authorized to discuss assignments with others; however, to ensure fair evaluations, you are not authorized to use the answers developed by another, copy the work completed by others in the past or present, or write your academic assignments in collaboration with another person.
CSE 167, Winter 2020 43
Academic integrity violation
If the work you submit is determined to be other than your own, you will be reported to the Academic Integrity Office for violating UCSD's Policy on Integrity of Scholarship. In accordance with the CSE department academic integrity guidelines, students found committing an academic integrity violation will receive an F in the course.
CSE 167, Winter 2020 44
Wait list
• Number of enrolled students is limited by
– Size of room
– Number of instructional assistants (TAs and tutors)
• General advice
– Wait for as long as you can
• UCSD policy: concurrent enrollment (Extension) students have lowest priority
CSE 167, Winter 2020 45