Help with shading language, multitexturing and...

Hello!
What is the problem whit these code:

gl.glEnable( GL.GL_TEXTURE_2D );

gl.glEnable( GL.GL_BLEND );
gl.glBlendFunc( GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA );

gl.glActiveTextureARB( GL.GL_TEXTURE0_ARB);
gl.glBindTexture( GL.GL_TEXTURE_2D, detailTextures[ p ] );
gl.glClientActiveTextureARB( GL.GL_TEXTURE0_ARB);
gl.glEnableClientState( GL.GL_TEXTURE_COORD_ARRAY );
gl.glTexCoordPointer( 2, GL.GL_FLOAT, 0, textureCoordinateBuffer );

gl.glActiveTextureARB( GL.GL_TEXTURE1_ARB);
gl.glBindTexture( GL.GL_TEXTURE_2D, groundBumpMaps[k][l] );
gl.glClientActiveTextureARB( GL.GL_TEXTURE1_ARB);
gl.glEnableClientState( GL.GL_TEXTURE_COORD_ARRAY );
gl.glTexCoordPointer( 2, GL.GL_FLOAT, 0, textureCoordinateBuffer );

gl.glEnableClientState( GL.GL_VERTEX_ARRAY );
gl.glEnableClientState( GL.GL_COLOR_ARRAY );
gl.glEnableClientState( GL.GL_TEXTURE_COORD_ARRAY );

gl.glVertexPointer( 3, GL.GL_FLOAT, 0, vertexBuffer[k][l] );
gl.glColorPointer( 4, GL.GL_UNSIGNED_BYTE, 0, colorBuffer[k][l][p] );

gl.glUseProgramObjectARB( normalShaderObj );

int baseTexture = gl.glGetUniformLocationARB( normalShaderObj, “Base”.getBytes() );
gl.glUniform1iARB( baseTexture, 0 );
int bumpTexture = gl.glGetUniformLocationARB( normalShaderObj, “Bump”.getBytes() );
gl.glUniform1iARB( bumpTexture, 1 );
int lightPos = gl.glGetUniformLocationARB( normalShaderObj, “lightPos”.getBytes() );
gl.glUniform3fARB( lightPos, 256.0f, 200.0f, 256.0f );

gl.glDrawElements( GL.GL_TRIANGLE_STRIP, vertexIndexCount, GL.GL_UNSIGNED_INT, vertexIndexBuffer[k][l] );

gl.glUseProgramObjectARB( 0 );

gl.glActiveTextureARB( GL.GL_TEXTURE1_ARB );
gl.glClientActiveTextureARB( GL.GL_TEXTURE1_ARB );
gl.glDisable( GL.GL_TEXTURE_2D );

gl.glActiveTextureARB( GL.GL_TEXTURE0_ARB );
gl.glClientActiveTextureARB( GL.GL_TEXTURE0_ARB );
gl.glDisable( GL.GL_TEXTURE_2D );

My shaders:
Vertex shader::::
varying vec4 color;
void main(void)
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = gl_MultiTexCoord1;
color = gl_Color;
}

Fragment shader:::
uniform sampler2D Base;
uniform sampler2D Bump;
varying vec4 color;
void main (void)
{
vec4 bumps = texture2D(Bump, gl_TexCoord[1].st );
gl_FragColor = bumps;
}

I can’t access both textures. Why?
I would like to use multitexturing (performed by a shader program), with compiled vertex arrays.
Mission imposible?:))

Are you having problems with the textures or the texture coordinates? Depend son how you define the multidimensional arrays there, you may not be providing any texture coordinates at all.

Also, note where you glEnable(GL_TEXTURE_2D) call is made. It is before you enable any of the individual texture units. Shift it down to just after glActiveTexture() and you should have it work properly.

BTW, you have a lot of redundant state setting in that code. You should remove it to avoid any future problems.

Redundant code? You mean, it makes nothing?
Which one?
Thanks.

By the way, my problem resolved. I had to rename the variables’ name in the shader program.
If the name of the variables contains Capital letter, it don’t works. Strange, but after having renamed it, the shader works.