Getting uniform variable location

every time i call glGetUniformLocation() it returns -1

the program runs fine but i cant change any of the uniform variables

they are declared like this:

uniform sampler2D textures;
uniform int numTextures;

any ideas

Can you post the part of your code where you are calling this? Usually a -1 means that the uniform variable is not found in the specified program object, or that it starts with a reserved prefix gl_*.

are you using your variables?

This is from the spec:

“A uniform is considered “active” if it is determined by the compiler
and linker that the uniform will actually be accessed when the executable code is
executed.”

any unactive variable will probably return -1.

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