Are shaders meant to replace GL 1.1-1.4?

K.I.L.E.R

Retarded moron
Veteran
I gather they are nothing more than mathametical formulas that are applied to pixels/vertices.

So how is fixed function completely replaced?
Can fixed function commands be used in conjunction with shaders to change parameters?
Or should fixed function commands be treated like the devil(stay away from them)?

Is there a paper that goes into a really deep discussion about shaders?
I would like to know how GL interacts with GLS.
 
K.I.L.E.R said:
I gather they are nothing more than mathametical formulas that are applied to pixels/vertices.
So is most of the fixed function pipeline. Hardware T&L simply performs all the vertex transformations and lighting calculations for you. With shaders, you manually specify how the transformation and lighting occurs.

So how is fixed function completely replaced?
Can fixed function commands be used in conjunction with shaders to change parameters?
Or should fixed function commands be treated like the devil(stay away from them)?
Shaders can still read state set by functions normally used by the fixed function pipeline (at least in OpenGL). However, the number of parameters one can set for a specific feature may be limited. For example, most hardware is limited to 8 simultaneous lights with the fixed function pipeline. One could also set parameters using functions specific to the shader spec. Either way, the shader treats the data however you want.

Is there a paper that goes into a really deep discussion about shaders?
I would like to know how GL interacts with GLS.
Well, there's some of ATI's early event presentations on GLSL. . .

http://www.ati.com/developer/gdc/gdc2003-gl2.pdf
http://www.ati.com/developer/SIGGRAPH03/The_OpenGL_Shading_Language-siggraph2003-2.pdf
 
When you specify variables in the shader and change them through your program would that have the same performance impact as if you were doing it through GL's fixed function pipeline?

Thanks Ostol.
 
I've never performed such a comparison, though I expect that performance is the same. Since the fixed function pipeline is apparently emulated through shaders in modern video cards, it would make sense that the fixed function state is emulated through the functions provided by the shader-API's functions.
 
Well, OpenGL ES 2.0 dropped the whole fixed function pipeline for both vertex and pixel processing in favor of shaders.
 
OpenGL ES 2.0 dropped a *small* section of the fixed function pipeline....

jpaana said:
Well, OpenGL ES 2.0 dropped the whole fixed function pipeline for both vertex and pixel processing in favor of shaders.
For a visual picture of what got dropped, see:
http://www.ati.com/developer/gdc/OpenGLShadingLanguage.pdf, slide 15.
(and to actually read what's on that slide, see:
http://www.opengl.org/documentation/specs/version1.1/state.pdf, print out the page large and highlight it yourself.)

There's still a *lot* of fixed function left before, between, and after vertex and fragment processing. In particular: primitive assembly, clipping and viewport transform, rasterization, texture filtering, and "per-fragment operations" (ownership test, scissor test, alpha test, stencil test, depth test, blending, dithering.)

OpenGL 2.0 defines "built-in" state for the shader environment. This is the fixed function context state that the vertex shader and fragment shader subsumes. (See http://mew.cx/glsl_quickref.pdf, for Michael Weiblen's excellent two page quick reference.)

OpenGL 2.0 ES drops this "built-in" state entirely.

Back to K.I.L.E.R's questions:

K.I.L.E.R said:
So how is fixed function completely replaced?
Fixed function isn't completely replaced, just a small portion of it. The portions of the fixed function that *are* replaced (vertex transformation and lighting, texture application) now *must* be done by the shader writer if you would like those effects.
K.I.L.E.R said:
Can fixed function commands be used in conjunction with shaders to change parameters?
In OpenGL 2.0, yes. The fixed function commands change the "built-in uniforms."

In OpenGL 2.0 ES, no.
K.I.L.E.R said:
Or should fixed function commands be treated like the devil(stay away from them)?
In OpenGL 2.0, it's generally a personal preference. There *are* some advantages to using some of the fixed function commands. Example - the fixed function matrix state has stacks, and the derived matrix state such as Inverse, Transpose, and InverseTranspose can be efficiently calculated when needed.

In OpenGL 2.0 ES, you have to stay away from some of the fixed function commands. They've been deleted. The savings in context state and the savings from the deleted entry points are substantial.

-mr. bill
----
Disclosure - "-mr. bill" is the nickname of Bill Licea-Kane
 
Last edited by a moderator:
Back
Top