which version of GL to target with using GLSL

Started by
1 comment, last by DracoLacertae 14 years, 9 months ago
Hi. My understanding is GLSL support began in OpenGL 1.4 as an extension, but moved to the core spec in 2.0. I also know there are some differences in the extension vs core version of GLSL. I have a few questions about this: 1. For those of you who are using GLSL, are you currently targeting GL 1.4 or 2.0? 2. Suppose a graphics card supports has openGL 2.0 support. Will that card still have GLSL available as an ARB extension? 3. I know that GLSL had changed slightly with each version. For instance, in the latest version there is no ftransform(). Will a program running GLSL on a new video card still have access to ftransform if calling from the ARB extension version?
Advertisement
1. GL 2.0 and up. ATI and NV have GL 2.1 on all their SM 2.0 GPUs

2. yes, as far as NV and ATI are concerned.

3. yes
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Thanks! I suspected the answers to #2 and #3 were yes. And now I realize the answer is 'duh', you don't have to run out and patch all the existing games on your system everytime there is a new version of opengl out!

As for #1, I think I'm going to have the policy of targeting the minimum version of GL that has what I want available as an extension. I would hate to lock out use of a feature on a card that supports it, just because they don't have the 'core' version of a particular thing.

This topic is closed to new replies.

Advertisement