glGetUniformLocation returns -1 with struct objects

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

glGetUniformLocation returns -1 with struct objects

phil1234
Hello,

I try to get a uniform location but it returns -1

/////////////////////////////// Shader code
struct LightSource
{
  vec4 position;
  vec4 diffuse;
};

uniform LightSource light;

////////////////////////////// Java code
int lightPositionLocation=gl.glGetUniformLocation(shaderProgramID, "light.position");
int lightDiffuseLocation=gl.glGetUniformLocation(shaderProgramID, "light.diffuse");

thanks
Reply | Threaded
Open this post in threaded view
|

Re: glGetUniformLocation returns -1 with struct objects

phil1234
damned I forgot shader were optimized
my uniform was not used in my code