I code in OpenGL and I've been reading some posts about this uber-shader approach.
It first sounded neat but on second thought having lots of shader programs will require lots of glUseProgram() calls in runtime, which is afaik the most expensive gl function to call in runtime. (said by L.Spiro as I recall)
Is this thing noted? Am I missing something? Are there better approaches for managing shaders in big engines?
Also, what about using uniforms to do dynamic branch selection? This may slow things a little, but avoids having the switch many programs in every frame.