shaders with OpenGL 1.4

Started by
6 comments, last by V-man 15 years, 5 months ago
hello, afaik OpenGL 1.4 can still do shaders, but how? for example the function glCreateShaderObjectARB is only availabel with OpenGL 2.0, right? what syntax do i need to use to get 1.4 compatibility with my shaders? thanks!
Advertisement
OpenGL 2.0 is only required for core support of shaders. If you don't have OpenGL 2.0, you have to use extensions instead (which is glCreateShaderObjectARB you mention). You need the extension present in your driver also.
glCreateShaderObjectARB is part of an extensions
http://www.opengl.org/registry/

you need
GL_ARB_shader_objects
GL_ARB_shading_language_100

and one of these at least
GL_ARB_vertex_shader
GL_ARB_fragment_shader

These were created before GL 2.0
All GPUs that support these extensions are really DX9 cards and eventually, GL 2.0 drivers were written for them.

If you have GL 1.4, then it is probably a old Radeon 8500 or Intel 950 or something like that.
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 guys,
i will try and use these extensions to get it running with 1.4

Quote:Original post by V-man
If you have GL 1.4, then it is probably a old Radeon 8500 or Intel 950 or something like that.


yes, it is an intel 950. unfortunately it seems a lot of laptop-users have this card and there are still new laptops sold with this card. that's why i want opengl 1.4 compatibility with my game. :-)

ok, so i found that the intel GMA 950 supports

GL_ARB_fragment_program
GL_ARB_vertex_program

but not

GL_ARB_shader_objects
GL_ARB_shading_language_100

does that make sense? what are they two above good for if you cant make shaders without the two below?

thanks!
GL_ARB_vertex/fragment_program is different from GL_ARB_vertex/fragment_shader. The first one is a separate, and old, shader interface. Second one is the newer you use with GL_ARB_shader_objects.
ah i see the difference now. thanks brother bob.

so how is it possible to get a GLSL shader running with those two extensions only?
Cg can compile GLSL code to those assembly forms (GL_ARB_fragment_program, GL_ARB_vertex_program)
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);

This topic is closed to new replies.

Advertisement