Which is better ?
To have one shader program with a lot of uniforms specifying lights to use, or mappings to do (e.g. I need one mesh to be pa
Most modern engines I know have a "shader cache" and use the second option, because apparently it's faster.
Also you can take a look at the ARB_shader_subroutine which allows dynamic linkage. But I think it's only available on DX11 class hardware.