I don't see the problem. Quoting from the GLSL 1.20 spec below, it looks
to me like you're lucky you're even getting 2 matrices -- the minimum
value for gl_MaxTextureCoords.
You can't simply use a uniform?
Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466
7.4 Built-In Constants
The following built-in constants are provided to vertex and fragment
shaders.
//
// Implementation dependent constants. The example values below
// are the minimum values allowed for these maximums.
//
const int gl_MaxLights = 8; // GL 1.0
const int gl_MaxClipPlanes = 6; // GL 1.0
const int gl_MaxTextureUnits = 2; // GL 1.3
const int gl_MaxTextureCoords = 2; // ARB_fragment_program
const int gl_MaxVertexAttribs = 16; // ARB_vertex_shader
const int gl_MaxVertexUniformComponents = 512; // ARB_vertex_shader
const int gl_MaxVaryingFloats = 32; // ARB_vertex_shader
const int gl_MaxVertexTextureImageUnits = 0; // ARB_vertex_shader
const int gl_MaxCombinedTextureImageUnits = 2; // ARB_vertex_shader
49
7 Built-in Variables
const int gl_MaxTextureImageUnits = 2; // ARB_fragment_shader
const int gl_MaxFragmentUniformComponents = 64;// ARB_fragment_shader
const int gl_MaxDrawBuffers = 1; // proposed ARB_draw_buffers
7.5 Built-In Uniform State
As an aid to accessing OpenGL processing state, the following uniform
variables are built into the
OpenGL Shading Language. All page numbers and notations are references
to the 1.4 specification.
//
// Matrix state. p. 31, 32, 37, 39, 40.
//
uniform mat4 gl_ModelViewMatrix;
uniform mat4 gl_ProjectionMatrix;
uniform mat4 gl_ModelViewProjectionMatrix;
uniform mat4 gl_TextureMatrix[gl_MaxTextureCoords];
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org