Simple question but I can't find the answer in a specification anywhere. I'm probably missing the obvious answer somewhere.
How many textures can I use at once in a WebGL Fragment shader? If it's variable, what is a reasonable number to assume for PC use? (Not so interested in mobile).
I need at least 23 in one of my shaders so want to know if I'll be able to do that before I start work on the code or if I'll need to do multiple passes.
You can find the answer at http://webglstats.com/webgl/parameter/MAX_TEXTURE_IMAGE_UNITS
It seems you are out of luck as the stats suggest that most only have 16.
I'm pretty sure you can find out with
WebGL (OpenGL ES 2.0) only requires 8 minimum for fragment shaders.
Note that the number of textures you can access is separate from the amount of times you can access 1 texture. Therefore, for example, if you wanted to access 2 textures using only 1 texture unit then combine the textures and adjust your UV coords. So for example put the contents of 2 textures [A] and [B] side by side into one texture [AB] and then
Of course you probably need to turn set filtering for no mips etc...