GLSL In OpenGL 1.5 vs. 2.0

I have some GLSL Shaders that I’ve tested on a variety of OpenGL 2.0 computers, but I tried my application for the first time on a computer with OpenGL 1.5, and to my surprise, it doesn’t seem to work (just a blank screen). My code uses gl.glIsFunctionAvailable(“glUseProgram”) to check for 2.0, then checks for “glUseProgramObjectARB” and then excutes code that should be equivalent based on the version - the functions are basically all the same, but for 1.5 the functions have ARB at the end. Anyone have any examples of GLSL working properly in 1.5 with the ARB extensions?

I use the ARB functions fine (although using LWJGL, but there should be no difference). I dont recall the ARB increasing the language version…

Both GL_SHADING_LANGUAGE_VERSION_ARB (in LWJGL, its ARBShadingLanguage100.GL_SHADING_LANGUAGE_VERSION_ARB) and GL_SHADING_LANGUAGE_VERSION (in LWJGL its GL20.GL_SHADING_LANGUAGE_VERSION) have the same version string…

Thats the proper way to test for various versions of GLSL, although there is only 1 version at the moment. Im not sure how JOGL/JSR-231 does it, but in LWJGL, you get the current context, then the capabilities of that context and check whether certain extensions are on or not…so to check for OpenGL2.0, its a call:


if(GLContext.getCapabilities().OpenGL20) { ... } else if (GLContext.getCapabilities().OpenGL15) { ... }

Thats the proper way of checking OpenGL version…JOGL/JSR-231 must have a similar context functionality…

DP

I just got the version number from glString(GL_VERSION) and parsed for the major version number - that seems to work in all tested cases. But just in case, I check if the functions are available - the non-ARB ones should only be available in 2.0 or later, and that seems to work properly too.

With a little more investigating, though, I worked out the problem (I had to wrapped DebugGL around the wrong GL object, and it gave me an error ones I fed it to the correct GL). Turns out that I was generating a texture with a non-power-of-2 size, which is fine in OpenGL 2.0, but not in <=1.5 . So it turns out its not really a GLSL problem - just one that looked like it because it was used only after the appropriate shader was activated.

This isn’t currently well documented (I’ve just checked in a sentence about it to the javadoc for the GL class) but you can do e.g. GL.isExtensionAvailable(“GL_VERSION_1_5”) to test for availability of a particular OpenGL version.