Introduction

When it comes to computer graphics, OpenGL is a widely-used library that helps create stunning visuals in applications and games. Within OpenGL, there are two different approaches to rendering graphics: the Fixed Function Pipeline (FFP) and the Programmable Pipeline (PP).

The FFP was supported by OpenGL versions up to 3.0, which was released in 2008. In OpenGL 3.1 and above, the FFP was removed from the core profile, which means that it is no longer part of the standard specification. However, some implementations may still support the FFP as an optional extension or in a compatibility profile.

The programmable pipeline was introduced in OpenGL 2.0, which was released in 2004. It became possible for the programmer to replace certain stages in the pipeline with their own programs, called vertex shaders and fragment shaders. Later versions of OpenGL added more types of shaders, such as geometry shaders, tessellation shaders, and compute shaders.

Fixed Function Pipeline (FFP)

Imagine you are a chef cooking a recipe with a predefined set of ingredients and cooking techniques. The Fixed Function Pipeline in OpenGL is like following a recipe that guides you step by step, without much flexibility to change the ingredients or cooking methods.

In the FFP, OpenGL provides a fixed set of functions and stages to process geometry and apply transformations, lighting, and texturing. These stages include vertex processing, primitive assembly, rasterization, and pixel processing. Each stage has predetermined operations that cannot be modified or customized.

To visualize this in terms of programming, think of the FFP as a closed box of predefined functions. You can use these functions to achieve specific results, but you have limited control over how those functions work behind the scenes.

Example -: In the FFP, you can use the glLight function to apply basic lighting to a 3D model. The FFP handles the calculations and lighting effects internally, and you have limited control over the finer details.

Programmable Pipeline (PP)

Now, let’s imagine you are an artist with a blank canvas, unlimited paint colors, and various brushes to create a masterpiece. The Programmable Pipeline in OpenGL is like being able to freely express your artistic vision without any predefined constraints.

In the Programmable Pipeline, developers have the power to write their own shaders, which are small programs executed by the graphics hardware. Shaders allow customization of the vertex processing and pixel processing stages, giving developers the ability to create complex effects, shaders, and unique rendering techniques. This flexibility allows for advanced rendering techniques, such as dynamic lighting, shadowing, and realistic effects.

Example -: In the Programmable Pipeline, you can write a shader that implements a custom lighting algorithm, allowing you to create advanced lighting effects. For example, you can create a shader that simulates realistic reflections or complex shadowing techniques.

Comparison Table

Fixed-Function Pipeline (FFP)Programmable Pipeline (PP)
Predefined stagesCustomizable stages
Configurable parametersProgrammable shaders
Limited effectsComplex effects
Older hardwareModern hardware

Real World Example

A real world example for the difference between the FFP and the PP is using a calculator versus writing a program. A calculator is like the FFP: it has a set of predefined functions that you can choose from, such as addition, subtraction, multiplication, or division. You can configure these functions by entering some numbers, but you cannot change how they work or add new functions.

A program is like the PP: it allows you to compute anything you want by using your own code. You can manipulate the data in any way you want, such as looping, branching, or calling other functions. You have complete control over what happens at each step of the computation.

Thanks for reading!