Professional Documents
Culture Documents
Openglfinal
Openglfinal
Openglfinal
Per-
Per-
Eval- Raster- frag-
Vertex
Comm- uator ization ment
opns. &
ands opns.
primitive
assembly
Texture
Pixel memory
opns.
Frame
In This first stage effectively takes any polynomial evaluator commands and buffer
evaluates them into their corresponding vertex
Prof. Kajaland attribute commands.
Vatekar
OpenGL Process geometric primitives -
points, line segments, and
Operation polygons as vertices and are
transformed, lit, and clipped to
Display the viewport in preparation for
Lists the next stage.
Per-
Comm- Per-
Eval- Raster- frag-
Vertex
uator ization ment
opns. &
opns.
primitive
assembly
Texture
Pixel memory
opns.
Frame
The second stage is the per-vertex operations, including transformations, buffer
lighting, primitive assembly, clipping, projection, and viewport mapping.
Prof. Kajal Vatekar
OpenGL Produces a series of
frame buffer addresses
Operation and associated values
using a two-dimensional
Display description of a point,
Lists line segment, or polygon
Per-
Per-
Eval- Raster- frag-
Comm- Vertex
uator ization ment
ands opns &
opns.
primitive
assembly
Texture
Pixel memory
opns.
Frame
In This 3rd stage produces fragments, which are series of framebuffer buffer
addresses and values, from the viewport-mapped primitives as well as bitmaps
Prof. Kajal Vatekar
and pixel rectangles
OpenGL Z-buffering, and blending of
incoming pixel colors with
Operation stored colors, and masking
and other logical operations
Display
on pixel values are done
Lists Solve
Error
Per-
Per-
Eval- Raster- frag-
Vertex
Comm- uator ization ment
opns &
ands opns.
primitive
assembly
Texture
Pixel memory
opns.
Frame
The fourth stage is the per-fragment operations. Before fragments go to the buffer
framebuffer, they may be subjected to Prof.
a series of Vatekar
Kajal conditional tests and
modifications, such as blending or z-buffering.
OpenGL Input data can be in
the form of pixels
Operation (image for texture
mapping) is processed
Display
in the pixel operations
Lists
stage.
Per- Per-
Eval- Vertex Raster- frag-
Comm- uator ops & ization ment
ands primitive opns
assembly
Texture
Pixel memory
opns
Frame
buffer
Prof. Kajal Vatekar
OpenGL architecture
• Commands may either be build up in display lists, or processed
immediately through the pipeline. Display lists allow for greater
optimization and command reuse, but not all commands can be put in
display lists.
• The first stage in the pipeline is the evaluator. This stage effectively takes
any polynomial evaluator commands and evaluates them into their
corresponding vertex and attribute commands.
• The second stage is the per-vertex operations, including transformations,
lighting, primitive assembly, clipping, projection, and viewport mapping.
• The third stage is rasterization. This stage produces fragments, which are
series of framebuffer addresses and values, from the viewport-mapped
primitives as well as bitmaps and pixel rectangles.
• The fourth stage is the per-fragment operations. Before fragments go to the
framebuffer, they may be subjected to a series of conditional tests and
modifications, such as blending or z-buffering.
• Parts of the framebuffer may be fed back into the pipeline as pixel
rectangles. Texture memory may be used in the rasterization process
when texture mapping is enabled.
Prof. Kajal Vatekar
OpenGL API
❖ Program Structure
▪ Step 1: Initialize the interaction between windows
and OpenGL.
▪ Step 2: Specify the window properties and further
create window.
▪ Step 3: Set the callback functions
▪ Step 4: Initialize the program attributes
▪ Step 5: Start to run the program
glutDisplayFunc(myDisplay);
display callback
myInit(); set OpenGLstate
glutMainLoop();
enter event loop
} Prof. Kajal Vatekar
Act like agent which hold the output, if not putting this line your output doesnot hold your output
GLUT Function
void myDisplay(){
/* clear the display */
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}/* End of GasketDisplay */