The OpenGL Shading Language ES specification delineates the number of uniforms that we are allowed to use.
Section 4.3.4 Uniforms
There is an implementation dependent limit on the amount of storage for uniforms that can be used for each type of shader. If this is exceeded, it will cause a compile-time or link-time error.
There is an implementation dependent limit on the amount of storage for uniforms that can be used for each type of shader. If this is exceeded, it will cause a compile-time or link-time error.
To find out the limit for your WebGL implementation, you can query WebGL using the gl.getParameter function with these constants:
gl.MAX_VERTEX_UNIFORM_VECTORS
gl.MAX_FRAGMENT_UNIFORM_VECTORS
The implementation limit is given by your browser and heavily depends on your graphics hardware. That said, even though your machine may have enough variable space, it does not necessarily mean that the problem is solved. We still have to define and map each of the uniforms and that can often lead to brittle and verbose code, as we will see in a later exercise.