Introduction to OpenGL Flashcards
OpenGL is a computer graphics rendering
application programming interface or API
is a computer graphics rendering
application programming interface, or API
OpenGL
With it, you can generate high-quality color images by rendering with geometric and image primitives
OpenGL
It forms the basis of many interactive applications that include 3D graphics
OpenGL
By using OpenGL, the graphics part of your application can be
- operating system independent
- window system independent
Where is OpenGL first developed?
Silicon Graphics (SGI) Computer Systems
What year is the first version of OpenGL?
1994
Client‐Server Model
* Application (Client)
* Server (Vendor OpenGL implementation)
OpenGL
OpenGL is object oriented
False
What company created OpenGL?
Khronos
What is the latest version of OpenGL?
4.6
In OpenGL everything is in
3D Space
The process of transforming 3D coordinates to 2D pixels is managed by the
graphics pipeline of OpenGL
The graphics pipeline can be divided into two large parts:
- The first transforms your 3D coordinates into 2D coordinates and the
- Second part transforms the 2D coordinates into actual colored pixels.
The blue shades represents a programmable pipeline called
shaders
Shaders are written using the
GLSL (OpenGL
Shading Language)
uses patches to describe an object’s shape and allows relatively simple collections of patch geometry to be tessellated to
increase the number of geometric primitives, providing better-looking
models.
Tessellation
The next shader stage allows additional
processing of individual geometric primitives, including creating
new ones, before rasterization.
Geometry Shader
This shading stage is optional but powerful
Geometry Shader
is the stage in the OpenGL Rendering Pipeline where the vertex outputs of the Vertex Processing undergo a variety of
operations. Many of these are setup for Primitive Assembly and
Rasterization stages.
Vertex Post-Processing
is a way of recording values output from the Vertex Processing stage into Buffer Objects. Only the last vertex processing stage can perform transform feedback.
Transform feedback
this stage organizes the vertices into their associated geometric primitives in preparation for clipping and rasterization.
The primitive assembly
the region of the
window where you’re permitted to draw
viewport
Occasionally, vertices will be outside of the viewport—the region of the window where you’re permitted to draw—and cause the primitive associated with that vertex to be modified so none of its pixels are outside
of the viewport.
Clipping
this stage maps the resulting primitive(s) to
the corresponding pixels on the final screen, resulting in fragments for the fragment shader to use.
Rasterization
is all the data required for OpenGL to render a single pixel.
Fragment
this stage calculates the final
color of a pixel and this is usually the stage where all the advanced OpenGL effects occur.
Fragment Shader
this operations take place after the Fragment Shader has executed. However, it is possible for these to be performed before the fragment shader.
Per-sample processing
OpenGL Rendering PipeLine
Vertex Specification
Vertex Shader
Tessellation
Geometry Shader
Vertex Post-Processing
Primitive Assembly
Rasterization
Fragment Shader
Per-sample processing
As input to the graphics pipeline we pass in a list of three 3D coordinates that should form a triangle in an array here called _________ it is a collection of vertices
Vertex Data
is a collection of data per 3D coordinate.
Vertex
As input to the graphics pipeline we pass in a list of three 3D coordinates that should form a triangle in an array here called Vertex Data
Vertex Specification
The first part of the pipeline and takes a single vertex as input.
Vertex Shader
Initializes GLUT and should be called before other GLUT and OpenGL functions.
glutInit(&argc, argv);
Creates a window on the screen with the title given by the argument.
glutCreateWindow(“simple”);
The function display() is called each time the window needs to be redrawn.
(pointer to a function)
glutDisplayFunc(display);
callback function. Global variables may be necessary to pass values among functions.
display()
Causes the program to enter an infinite event‐processing loop. It should be the last statement in the main() function
glutMainLoop();
specifies the end of a list of vertices
glEnd()
clears all buffers whose bits
are set in mask
glClear()
forces previously buffered OpenGL
commands to execute
glFlush()
specifies the beginning of an object of type mode. Modes include GL_POINTS, GL_LINES, and GL_POLYGON
glBegin()
specifies the location of the
vertex
glVertex()
How many is the Geometric Primitves in OpenGL?
10