Mixing fixed function pipeline and shaders

Hello Everyone,

I am currently working on a software that uses OCC and a custom
openGL-based viewer. Truth is, the more I use OCC, the more I want to use the OCC viewer, including the AIS interface.

However, the graphics of my software (and the sometimes huge chunks of code that come along),
were designed for OpenGL 1.x and its fixed-function pipeline.

Hence the following question : is it possible to use methods like gl_quads and gl_texture3D along with a GLSL-based viewer in OCC ?

Don't get me wrong, I am totally pro-shader.
Fact is, and I am sure you are all aware of it : migrating code is a time-consuming, costful and tiresome operation,
so I want to avoid a complete rewriting for now.

I believe that OpenGL makes it possible to perform multiple rendering pass with both shaders and fixed-pipeline functions.
I am also aware that it should be avoided. But the migration process would be faster, and I would feel relieved.
What do you think ?

Best regards.

Daniel Neander's picture


If I understand correctly the reply to my post here
http://dev.opencascade.org/index.php?q=node/952 may help you.

Rémi Loze's picture

Hello Daniel,

Yes, that's it.
To sum up, yes it is possible, not necessarily easy,
not necessarily maintainable in a long run, but it is possible.
Many thanks, it relieves me quite a lot.

Best regards.

Daniel Neander's picture

No problem, as you said it is better to use shaders for countless reasons but in your case it is sufficient.