1/51
01 Handout 1 - Introduction to Computer Graphics.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Computer Graphics
describes the use of computers to create and manipulate images
Modeling
deals with the mathematical specification of shape and appearance properties in a way that can be stored on the computer
Rendering
deals with the creation of shaded images from 3D computer models
Animation
a technique to create an illusion of motion through a sequence of images
Raster
an array of pixels (picture elements) displayed on a screen, arranged in a grid with two (2) dimensions
Pixels
specify colors using triples of floating-point numbers between 0 and 1, which represent the amount of red, green, and blue light existing in a color
RGB values
0 - indicates that no amount of color exists
1 - represents that color is displayed at full intensity

Resolution
is the number of pixels in the raster
Precision
is the number of bits used for each pixel
Buffer
(data buffer or buffer memory)
is a part of a computer’s memory that serves as temporary storage for data while being moved from one location to another
FrameBuffer
pixel data is stored in a region of memory
may contain multiple buffers that store different types of data for each pixel
Color Buffer
stores RGB values
at minimum, the framebuffer must contain this
Depth Buffer
stores distances from points on scene objects to the virtual camera.
determine whether the object’s points are in front of or behind other objects
from the camera perspective
Stencil Buffer
store values used in generating advanced effects
such as shadows, reflections, or portal rendering
Frame
A single image that is displayed in animations
Frame Rate
the speed or rate at which images appear in an animation
measured in frames per second (FPS)
Graphics Processing Unit
(GPU)
features a highly parallel structure that makes it more efficient than CPUs for rendering computer graphics
Shaders
programs run by GPUs
used to perform many different computations required in the rendering process
Application Programming Interface
(API)
implemented by Shader programming languages
defines a set of commands, functions, and protocols that can be used in interacting with an external system such as the GPU
DirectX API & High-Level Shading Language (HLSL)
API and their shader language:
used on Microsoft platforms, including the Xbox game console
Metal API & Metal Shading Language
API and their shader language:
runs on modern Mac computers, iPhones, and iPads
OpenGL (Open Graphics Library) & OpenGL Shading Language (GLSL)
API and their shader language:
a cross platform library
is the most widely adopted graphics API
Graphics Pipeline
is an abstract model used to describe a sequence of steps needed in rendering a three-dimensional scene
pipelining enables a computational task to be split into subtasks thus increasing overall efficiency
increase the efficiency of the rendering process, enabling images to be displayed at faster rates
Application
4 stages of pipeline model used in OpenGL:
initializing the window where rendered graphics will be displayed
sending data to the GPU
Geometry Processing
4 stages of pipeline model used in OpenGL:
determining the position of each vertex of the geometric shaped to be rendered
implemented by a program known as vertex shader
Rasterization
4 stages of pipeline model used in OpenGL:
determining which pixels correspond to the geometric shapes to be rendered
Pixel Processing
4 stages of pipeline model used in OpenGL:
determining the color of each pixel in the rendered image
involving a program called a fragment shader
Creating a window where the rendered graphics will be displayed
Stage 1: Application:
the window must be initialized to read the graphics from the GPU framebuffer
for animated and interactive applications, the main application contains a loop that repeatedly re-renders the scene, usually aiming for a rate of 60 FPS
Reading data required for the rendering process
Stage 1: Application:
data may include vertex attributes which is stored in vertex buffer objects (VBOs).
stores images to be used as textures in texture buffers
source code for the vertex shader and fragment shader programs need to be sent to the GPU, compiled, and loaded
Vertex Attribute
describe the appearance of the geometric shapes being rendered
Vertex Buffer Objects
(VBOs)
a GPU memory buffers used to store vertex attribute data
Texture Buffers
stores images to be used as textures
Sending data to the GPU
Stage 1: Application:
application needs to specify the associations between attribute data stored in VBOs and attribute variables in the vertex shader program.
a single geometric shape may have multiple attributes for each vertex (such as position and color).
the corresponding data is streamed from buffers to variables in the shader during rendering.
frequently, it is also necessary to work with many sets of such associations.
multiple geometric shapes may be rendered by the same shader program
each shape may also be rendered by different program
these set of associations can be managed using vertex array objects (VAOs)
Vertex Array Objects
(VAOs)
stores the information of the sets of associations and can be activated and deactivated as needed during the rendering process
Mesh
the shape of a geometric object is defined by ___
a collection of points that are grouped into lines or triangles

Vertex
the properties or attributes that are specific to rendering each individual point are grouped together into a data structure called ___
should contain the three-dimensional position of the corresponding point.
Includes:
a color to be used when rendering the point
Texture coordinates (or UV coordinates)
a normal vector
Texture Coordinates
(or UV Coordinates)
indicate a point in an image that is mapped to the vertex
Normal Vector
indicates the direction perpendicular to a surface and is typically used in lighting calculations
Wireframe
Vertex Colors
Texture
with Lighting Effects 🍒
figures that illustrated different renderings of a sphere that make use of these attributes

Model Transformation
Stage 2: Geometry Processing
the collection of points defining the intrinsic shape of an object may be translated, rotated, and scaled
the object appears to have a particular location, orientation, and size with respect to a virtual three-dimensional world
the coordinates expressed from this frame of reference are in world space
World Space
the origin is at the center of the scene
View Transformation
Stage 2: Geometry Processing
coordinates in this context are said to be in view space
View Space
(or camera space, or eye space)
is the result when world-space coordinates are transformed to coordinates in front of the user’s view
Projection Transformation
Stage 2: Geometry Processing
coordinates expressed at this stage are in clip space
Clip Space
any points outside the specified region are discarded or clipped from the scene
Stage 3: Rasterization
once the vertex shader has specified the final positions of each vertex, the rasterization stage begins.
the points themselves must first be grouped into the desired type of geometric primitive: points, lines, or triangles, consisting of sets of 1, 2, or 3 points
for lines and triangles, additional information must be specified
For example: an array of points [A, B, C, D, E, F] is to be grouped into lines
they could be grouped in disjoint pairs, such as (A, B), (C, D), (E, F), producing a set of disconnected line segments
the could also be grouped in overlapping pairs such as (A, B), (B, C), (C, D), (D, E), (E, F)
Line Strip
a set of connected line segments
array of points are grouped in overlapping pairs
Primitive Assembly
process of grouping points into geometric primitives
Fragment
is created for each pixel corresponding to the interior of a shape
a collection of data used to determine the color of a single pixel in a rendered image
Raster Position
also called pixel coordinates
the data stored in a fragment always includes __
Fragment Shader
a program applied to each of the fragments to calculate their final color.
Stage 4: Pixel Processing
primary purpose of this stage is to determine the final color of each pixel, storing this data in the color buffer within the framebuffer.
this calculation may involve a variety of data stored in each fragment, in combination with data globally available during rendering
a base color applied to the entire shape
colors stored in each fragment (interpolated from vertex colors)
textures (images applied to the surface of the shape), where colors are sampled from locations specified by texture coordinates
light sources, whose relative position and/or orientation may lighten or darken the color, depending on the direction the surface is facing at a point, specified by normal vectors