… i want to used two different textures in my fragment shader … seems to be no problem with texture2D() … but it doesn’t work …
i’m loading my textures and bind them … i thought i have to use the texturename in my fragment shader as sampler2d value … but looks like it isn’t the right way …
GLuint a = 0;
GLuint b = 0;
char nameA[256] = “bla”
char nameB[256] = “blubb”
Image ta, tb;
imgLoadImage( ta, nameA);
imgLoadImage( tb, nameB);
glGenTextures( 1, &a);
glTexParameteri( …
… and all the other texture stuff …
glGenTextures( 1, &b);
… same as a …
and now i want to use them both in my shader …
loc = glGetUniformLocationARB(*shaderProgam, “baseImage”);
glUniform2fvARB( loc, 1, &a);
loc = glGetUniformLocationARB(*shaderProgam, “shadowMap”);
glUniform2fvARB( loc, 1, &b);
… but this doesn’t work … perhaps i didn’t really understood the meaning of an texture unit … ist it similar to the texture name or discribes it a part of an multitexture???