Passing an array from JS to WebGL using a texture

You can pass an array through to shaders as a uniform, but (a) accessing elements can be painful (Google for "index expression must be constant"), and (b) IIRC the OpenGL ES spec states that an implementation only needs to support a relatively small (128 elements?) array size. As such, it's worth knowing how to (ab)use textures to serve as arrays.

External references:

Debug messages will appear here
Debug canvas: