PDA

View Full Version : Multitexturing problem - Help me please!



th0r1000
07-26-2006, 01:59 PM
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_LIN EAR,GL_TEXTURE_2D);
LoadTexture('l3d.jpg',l3d,false,GL_LINEAR,GL_LINEA R,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?

zeoverlord
07-26-2006, 04:13 PM
try this instead
glUniform1iARB(loc1,0);
glUniform1iARB(loc2,1);
More about this on this site (http://www.flashbang.se/index.php?id=22) .

glAren
07-27-2006, 02:37 AM
Because the second parameter of glUniform1iARB is texture unit, not texture graphics card id.

th0r1000
07-30-2006, 02:32 PM
Thanks, I tried it and it worked.