Why OF uses openGL 2.1 as a default setting?

What are pros and cons of using openGL 2.1 instead of higher versions in OF?
Does code run faster in 2.1 than in 3.x? Or is 2.1 more compatible with openGL ES1?
I think some features in OF only works from 3.x (e.g. ofLight::setAreaLight).
So what would be the benefit of using 2.1 in spite of its missing features?

the opengl 3 version of openframeworks uses several shaders internally to simulate all the functionality that 2.1 has by default and although right now it works pretty well and in some things even better than 2.1, for example lights and materials are calculated per fragment and as you mention there’s an extra type of light. it’s been kind of experimental until now since there’s so many platforms and graphics drivers to support. in the next major release after 0.10 we’ll surely switch the default to use the programmable renderer

1 Like

Thank you for your answer @arturo
So would you recommend the version 3.3? (the last opengl 3)
Do you think 3.3 based OF is stable enough in terms of cross platform app development when compared to 2.1?

yes if you are doing anything with shaders, materials lights… using the programmable renderer is the most recomended. if you are on osx you can use up to opengl 4.2 on linux and windows up to 4.5

1 Like

Hey @arturo I’m using OSX 10.11.6 and openGL 4.2 doesn’t work on my computer.
It works up to 4.1 but not higher. So I decided to use 4.1. I hope it works on other platforms too.

oh yeah 4.1 is the maximum supported in osx i think. if you are not using anything fancy that requires opengl 4 it’s also ok to stay at 3.3 for example which already has the most usually used features


Thank you @arturo :slight_smile:

I found a link that shows list of Mac computers and supported openGL version.