Fixed Function Pipeline: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
Clarification and correction
Upgraded description of fixed functionality with examples and interop.
Line 1: Line 1:
{{deprecated}}
{{deprecated}}


OpenGL exposes features of the underlying graphics hardware to application developers. Before the advent of programmable shading processors, a graphics processing unit(GPU) would integrate dedicated hardware to do specific operations. An example is the concept of separate transform and lighting engines built into the legacy GPUs to support hardware-sided transformation of vertices and lighting calculations. These parts of the GPU are not programmable and can only be configured using corresponding OpenGL functions. The GPU will then use this configuration to perform, for instance, hardware-accelerated vertex transformations. In this case the term ''fixed'' stems from the fact that the exposed hardware may be used only by means of a limited, specific set of special-purpose functions.
The term '''Fixed Function Pipeline''' commonly refers to the set of configurable processing state present in older versions of OpenGL that have since been replaced by [[Shader]]s of some sort. While the current OpenGL pipeline still retains non-programmable state, that is not typically what people are referring to when they say "fixed function".


Modern desktop GPUs integrate unified shading processors which are able to process multiple shading stages and can be programmed using high-level shading languages like [[GLSL|GLSL]]. For instance, a single processor is able to execute shading stages for both vertex and fragment processing. While there are still parts of the hardware that are only configurable, OpenGL has become shader centric and most of the formerly fixed functionality can, if needed, be emulated using programmable hardware.
The purpose of OpenGL is to expose features of the underlying graphics hardware to application developers. In the days before graphics hardware was programmable, such hardware exposed a different rendering pipeline based on user-provided configuration rather than [[Shader|user-provided programs]].


OpenGL 3.0 was the last revision of the specification which fully supported both fixed and programmable functionality. In modern OpenGL, almost all functions expressing fixed-function concepts are removed from the [[core|core profile]].
The general OpenGL [[Rendering Pipeline]] was more or less the same then as it is for modern hardware. However, in place of the programmable stages were built-in math operations. The user would provide specific matrices and other configuration parameters. In this way, the user could get the system to do a number of useful things. But it lacked the flexibility of a fully configurable system.
 
For example, in place of the [[Fragment Shader]] is a complex set of configurations called the "texture environment". Each [[Texture]] bound to the rendering context is also associated with a texture environment. This environment defines which texture coordinates are used to access the texture, as well as what to do with the color fetched from that texture. A texture's environment was not [[Texture]] object state; it was context state associated with a texture unit.
 
Other configuration state existed for [[Vertex Processing]]. In this stage, transformation and lighting was fairly hard-coded and inflexible, only allowing for multiplication of attributes with user-provided matrices. Hardware support for lighting only extended as far as the [https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model Blinn-Phong lighting model], [https://en.wikipedia.org/wiki/Gouraud_shading computed per vertex and interpolated as a final light intensity]. It did allow for some nifty tricks by allowing the user to specify matrices for transforming texture coordinates, as well as a simple distance fog model.
 
== Support ==
 
OpenGL 3.0 was the last revision of the specification which fully supported both fixed and programmable functionality. Even so, most hardware since the OpenGL 2.0 generation lacked the actual fixed-function hardware. Instead, fixed-function processes are emulated with shaders built by the system.
 
In OpenGL 3.2, the [[Core Profile]] lacks these fixed-function concepts. The compatibility profile keeps them around. However, many newer features of OpenGL cannot work with fixed function, even when it might seem possible for them to interact. For example, [[Tessellation]] is defined in terms of shaders, so it makes sense for the fixed function pipeline to not be able to work with it. However, [[Array Texture]]s theoretically only need an extra texture coordinate, yet they cannot be used without shaders.
 
Similarly, textures with [[Image Format|non-normalized integer formats]] cannot be used with fixed-function. This is primarily because of the mathematics behind texture environments is fundamentally rooted in floating-point operations. There are many other features of OpenGL that don't work in the fixed function pipeline.


[[Category:Deprecated]]
[[Category:Deprecated]]
{{stub}}

Revision as of 18:16, 7 February 2015

The term Fixed Function Pipeline commonly refers to the set of configurable processing state present in older versions of OpenGL that have since been replaced by Shaders of some sort. While the current OpenGL pipeline still retains non-programmable state, that is not typically what people are referring to when they say "fixed function".

The purpose of OpenGL is to expose features of the underlying graphics hardware to application developers. In the days before graphics hardware was programmable, such hardware exposed a different rendering pipeline based on user-provided configuration rather than user-provided programs.

The general OpenGL Rendering Pipeline was more or less the same then as it is for modern hardware. However, in place of the programmable stages were built-in math operations. The user would provide specific matrices and other configuration parameters. In this way, the user could get the system to do a number of useful things. But it lacked the flexibility of a fully configurable system.

For example, in place of the Fragment Shader is a complex set of configurations called the "texture environment". Each Texture bound to the rendering context is also associated with a texture environment. This environment defines which texture coordinates are used to access the texture, as well as what to do with the color fetched from that texture. A texture's environment was not Texture object state; it was context state associated with a texture unit.

Other configuration state existed for Vertex Processing. In this stage, transformation and lighting was fairly hard-coded and inflexible, only allowing for multiplication of attributes with user-provided matrices. Hardware support for lighting only extended as far as the Blinn-Phong lighting model, computed per vertex and interpolated as a final light intensity. It did allow for some nifty tricks by allowing the user to specify matrices for transforming texture coordinates, as well as a simple distance fog model.

Support

OpenGL 3.0 was the last revision of the specification which fully supported both fixed and programmable functionality. Even so, most hardware since the OpenGL 2.0 generation lacked the actual fixed-function hardware. Instead, fixed-function processes are emulated with shaders built by the system.

In OpenGL 3.2, the Core Profile lacks these fixed-function concepts. The compatibility profile keeps them around. However, many newer features of OpenGL cannot work with fixed function, even when it might seem possible for them to interact. For example, Tessellation is defined in terms of shaders, so it makes sense for the fixed function pipeline to not be able to work with it. However, Array Textures theoretically only need an extra texture coordinate, yet they cannot be used without shaders.

Similarly, textures with non-normalized integer formats cannot be used with fixed-function. This is primarily because of the mathematics behind texture environments is fundamentally rooted in floating-point operations. There are many other features of OpenGL that don't work in the fixed function pipeline.