Multitexturing problem - Help me please!

I am trying to implement the multitexturing shader from lighthouse3d but I have been struggling for the past 3 day to get it working.

I load my extensions load my textures but only one of them displays at a time. the code i use to load my texture is the following:

PGS is string;

LoadTexture(‘crate.jpg’,tex,false,GL_LINEAR,GL_LINEAR,GL_TEXTURE_2D);
LoadTexture(‘l3d.jpg’,l3d,false,GL_LINEAR,GL_LINEAR,GL_TEXTURE_2D);

PGS := ‘tex’;
loc1 := glGetUniformLocationARB(ProgramObject,@PGS);
PGS := ‘l3d’;
loc2 := glGetUniformLocationARB(ProgramObject,@PGS);
glUniform1iARB(loc1,tex);
glUniform1iARB(loc2,l3d);

if this correct and is GL_TEXTURE_2D the correct target? is this correct at all? what do I have to do?

could someone please shed some light on this?

try this instead
glUniform1iARB(loc1,0);
glUniform1iARB(loc2,1);
More about this on this site .

Because the second parameter of glUniform1iARB is texture unit, not texture graphics card id.

Thanks, I tried it and it worked.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.