1/69
Looks like no tags are added yet.
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
Rendering a scene produces a
raster
is 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; a value of 0 indicates that no amount of that color exists, while a value of 1 represents that color is displayed at full intensity
Resolution
is the number of pixels in the raster while precision is the number of bits used for each pixel.
Resolution
The quality of an image depends partly on its
buffer (or 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 called the
color buffer
which stores RGB values.
At a minimum, the framebuffer must contain a
depth buffer
When rendering a 3D scene, the framebuffer must also contain a
depth buffer
stores distances from points on scene objects to the virtual camera.
Depth values
determine whether the object's points are in front of or behind other objects
stencil buffer
Finally, framebuffers may contain a buffer called a Finally, framebuffers may contain a buffer called a
frame
each of the images that is displayed is called a
frame rate and is measured in frames per second (FPS).
The speed or rate at which these images appear is called the
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 are called
application programming interface (API)
Shader programming languages implement an ------------, which 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)
used on Microsoft platforms, including the Xbox game console
Metal API & Metal Shading Language
runs on modern Mac computers, iPhones, and iPads
OpenGL (Open Graphics Library) API & OpenGL Shading Language (GLSL)
a cross-platform library - OpenGL 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.
Application
initializing the window where rendered graphics will be displayed; sending data to the GPU
Geometry Processing
determining the position of each vertex of the geometric shapes to be rendered, implemented by a program known as vertex shader
Rasterization
determining which pixels correspond to the geometric shapes to be rendered
Pixel Processing
determining the color of each pixel in the rendered image, involving a program called a fragment shade
Creating a window where the rendered graphics will be displayed:
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
This data may include vertex attributes, which describe the appearance of the geometric shapes being rendered.
vertex buffer objects (VBOs
The vertex attribute data is stored in GPU memory buffers called
Lastly, source code for the vertex shader and fragment shader programs needs to be sent to the GPU, compiled, and loaded.
texture buffers
while images to be used as textures are stored in
Sending data to the GPU
The application needs to specify the associations between attribute data stored in VBOs and attribute variables in the vertex shader program
vertex array objects (VAOs)
Each shape may also be rendered by a different shader program. These sets of associations can be managed using ________. VAOs store this information and can be activated and deactivated as needed during the rendering process.
Geometry Processing
The shape of a geometric object is defined by a mesh, a collection of points that are grouped into lines or triangles
mesh
The shape of a geometric object is defined by a
vertex
Apart from the object's overall shape, additional information may be required to describe how the object should be rendered. The properties or attributes that are specific to rendering each individual point are grouped together into a data structure called a
Texture coordinates (or UV coordinates)
which indicate a point in an image that is mapped to the vertex
normal vector
which indicates the direction perpendicular to a surface and is typically used in lighting calculations
Model transformation
The collection of points defining the intrinsic shape of an object may be translated, rotated, and scaled. Hence, the object appears to have a particular location, orientation, and size with respect to a virtual three-dimensional world.
world space
the origin is at the center of the scene
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.
View transformation
Coordinates in this context are said to be in view space
Projection transformation
Any points outside the specified region are discarded or clipped from the scene; coordinates expressed at this stage are in clip space.
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.
(called a line strip)
They could also be grouped in overlapping pairs, such as (A, B), (B, C), (C, D), (D, E), (E, F), producing a set of connected line segments
primitive assembly
The process of grouping points into geometric primitives is termed
fragment
is a collection of data used to determine the color of a single pixel in a rendered image.
raster position
The data stored in a fragment always includes the ________, also called pixel coordinates.
fragment shader
During the first part of the pixel processing stage, a program called the _________ is applied to each of the fragments to calculate their final color
Stage 4: Pixel Processing
The primary purpose of this stage is to determine the final color of each pixel, storing this data in the color buffer within the framebuffer. During the first part of the pixel processing stage, a program called the fragment shader is applied to each of the fragments to calculate their final color.
window
is a graphical interface element that displays an application's content.
Startup
During this stage, objects are created, values are initialized, and any required external files are loaded.
Main Loop
Process Input - checks if the user has performed any action that sends data to the computer, such as pressing keys on a keyboard or clicking buttons on a mouse.
Update - changes values of variables and objects.
Render - creates graphics that are displayed on the screen.
This stage repeats continuously while the application is running
It consists of the following three (3) substages:
Shutdown
This stage typically begins when the user performs an action indicating that the program should stop
Pygame
is a set of Python modules designed for creating video games.
use the pygame.display.set_mode() method.
To set up a window using Pygame
point
A ____is a location in space. It is the most basic graphical element. To render a single point on the screen, use a vertex shader
main ()
Every shader must contain a _______ function
vertex buffers.
Every vertex shader that you write will use arrays of data stored in
glVertex3f.
Each of the triangle's vertices is specified by a call to the function
glBegin and glEnd
vertices must be specified between calls to
Uniform variables
are global variables that can be accessed by the vertex shader or the fragment shader, and whose values are constant while each shape is being drawn (can be changed between draw function calls).
uniform
Uniform shader variables, declared with the type qualifier ________, provide a mechanism for directly sending data from variables in a CPU application to variables in a GPU program.
glGetUniformLocation
The ___________function returns a value used to reference a uniform variable (indicated by the type qualifier uniform) with the name indicated by the parameter variableName and declared in the program referenced by the parameter programRef. If the variable is not declared or not used in the specified program, -1 is returned.
Pygame
library provides support for working with user input events. Pygame detects keydown events and keyup event
keyup events
while ______events occur the moment the key is released.
discrete
An event is said to be ______if it happens once at an isolated point in time.
continuous
It is said to be ______if it continues happening during an interval of time