Skip to content

Confusing message: The shader doesn't have a uniform called "foo" #2593

Description

@SableRaf

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 ?

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions