Here's the minimal code to get that (non crashing) message.
PDE
PShader shader;
void setup() {
size(100,100,P2D);
shader = loadShader("shader.glsl");
shader.set("foo", 0);
}
GLSL
uniform int foo;
void main(void)
{
gl_FragColor=vec4(1.0,0.0,0.0,1.0);
}
Console
The shader doesn't have a uniform called "foo"
The compiler removes "inactive" uniforms which explains why Processing can't find it, however, this message can be very confusing for beginners.
If there's no way to detect that case, how about replacing the message with The shader doesn't have a uniform called "foo" or the "foo" uniform is declared but not used ?
Here's the minimal code to get that (non crashing) message.
PDE
GLSL
Console
The compiler removes "inactive" uniforms which explains why Processing can't find it, however, this message can be very confusing for beginners.
If there's no way to detect that case, how about replacing the message with
The shader doesn't have a uniform called "foo" or the "foo" uniform is declared but not used?