I am trying to pass a variable timeVar (a float initially set to 0.0) that changes in my display() method with the line
timeVar = time(0);
to my fragment shader. Then I do this
safe_glUniform1f(h_uTime, timeVar);
and pass it to my shader program like so
h_uTime = safe_glGetAttribLocation(h_program, "uTime");
But I keep getting this error. Please help!
WARN: uTime cannot be bound (it either doesn't exist or has been optimized
away). safe_glAttrib calls will silently ignore it.
Since uTime
is a uniform and not an attribute, using glGetAttribLocation
will always result in an error. One has to use glGetUniformLocation
instead.