[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Public WebGL] Issue with Uniform[1,2,3,4][i,f][v], etc...

I just ran over something I didn't know.  From the OpenGL ES 2.0 spec

Section 2.10.4

If the value of location is -1, the Uniform* commands will silently ignore the
data passed in, and the current uniform values will not be changed.

That probably means ctx.uniform1f(location, value) and all the related functions should silently do nothing if location == null

That way, like OpenGL, the following WebGL code will work

var location = ctx.getUniformLocation("someUniformTheDoesNotExist");
ctx.glUniform1f(location, 1.0);  // silently does nothing.

Currently I think most implementations are failing that example.

It seems like the WebGL spec should probably mention this.