I am trying to make a 2D game engine using OpenGL ES 2.0 (iOS for now). I\'ve written Application layer in Objective C and a separate self contained RendererGLES20 in C++. No GL
As datenwolf says, shaders are not supposed to be generic.
That said, in theory, you can just swap out shaders code as you wish, as long as it uses all the same uniform
, in
and out
parameters nothing will really be able to tell the difference. That said, this is probably not a good idea at all.
If you want such flexibility, you probably want to look at introducing some sort intermediary scripting layer. Your engine can provide this scripting layer all the information you want it to, and the script layer can take care of working out what uniforms to set and what to set them to. It is not a trivial thing do, but then what you are trying to do is not exactly easy.