Definition: OpenGL (Open Graphics Library) is a cross-platform, hardware-independent API for rendering 2D and 3D graphics. It provides a set of functions for graphics programming, allowing developers to interact with graphics hardware without worrying about device-specific details.
Key Features:
OpenGL follows a client-server model:
Architecture can be divided into several conceptual stages:
The application generates geometry and scene data.
Calls OpenGL functions to:
OpenGL is a state machine, meaning it maintains a set of states that affect rendering.
Examples of states:
When a rendering command is issued, OpenGL uses the current state to produce the output.
Each fragment undergoes per-fragment operations such as:
The processed fragments are written to the framebuffer, which stores pixel values for display.
Includes operations like:
The framebuffer output is finally sent to the display device.
OpenGL Rendering Pipeline:
Application Stage (Client)
|
v
Vertex Processing (Transformations, Lighting)
|
v
Primitive Assembly (Lines, Triangles, Polygons)
|
v
Rasterization (Convert primitives to fragments)
|
v
Fragment Processing (Texturing, Shading)
|
v
Framebuffer Operations (Depth, Blend)
|
v
Display Output
| Component | Function |
|---|---|
| Application | Sends geometry, transformation, and rendering commands |
| OpenGL API | Defines functions for graphics rendering and state management |
| Graphics Pipeline | Series of stages converting 3D data to 2D images |
| State Machine | Maintains current rendering states (color, transformations, textures) |
| Framebuffer | Stores final pixel data for display |
| GPU/Graphics Hardware | Executes OpenGL commands efficiently and performs parallel rendering |
Open this section to load past papers