I’m trying to get into the world of fragment shaders but ran into an issue that only appears on some devices. I’m driving the shader with particles that I’m calculating in the sketch, then passing a list of those particles to the shader by using uniform arrays. It seemed to work exactly as expected. Then someone reported that they were getting an ERROR: too many uniforms on their ipad.
I went digging into this and of course it makes sense, all devices have their own maximum uniforms count.
So my question: What can I do to resolve this so that it can work reliably on any device? Right now I just hard-coded a maximum amount of particles which sets the uniform’s starting array length. Is there a better approach to this? Or maybe there’s a better approach to draw particles on the screen instead of a huge uniform array? I’m new to shaders so I’m oblivious if this not what I should be doing.
You can find sketch and shader here: https://www.openprocessing.org/sketch/835887#