DeanoC said:
You are trying to convince us to lower our art quality in the name of speed.
No, I'm not. I'm saying that using 10,000 shaders for 10,000 materials is misuse of the API, since even if you have 10,000 permutations you don't have 10,000 completely different situations. You got a couple of dozens at most, and thus should use a couple of dozen shaders. Just learn to use the if-statements, constants, and all that.
Shaders are very flexible, and it should be used as such. It wasn't invented as a replacement for glPushAttrib()/glPopAttrib(). Shaders aren't an excuse for writing naive and brute force applications.
To illustrate my point, did anyone ever design a game editor in which the artist paints the texture on all walls individually? If we wanted we could just let the game generate a texture for every surface, bake the lightmap into the base texture and simply use plain texturing on everything. How would it run? It would run like ass. It would take a lot of time to load all the textures, we would overflow the texture memory, would get a lot of texture switches.
How would you view such a design? I would view it as flawed, badly written, and all that. I wouldn't expect the driver to handle such misuse well, and would oppose to spending driver developer time on trying to get something useful out of the situation. No, you don't design your app that way, instead you design it so that the artist creates a texture, loads it into his editor and applies it on numerous surfaces. If you do lighting you perhaps make that with lightmaps. You don't create a lightmap for every surface. No, you pack many lightmaps into a larger texture. Yes, it requires more work, but we're not here to satisfy lazy developers. You just don't feed your API with 10,000 textures if you want performance and short load times. It's not the driver's responsibility to handle suboptimal use of the API and hardware.
10,000 shaders it pretty much at the same level. A shader takes time to load, just like a texture. A shader takes up resources, just like a texture. Switching shaders is expensive, just like texture. A developer must be aware of all this, and write the application accordingly, or suffer to consequences of bad performance and long load times.
In your standard lightmapped game, every surface looks different. That's not reason enough to make a different texture for every surface, no, you just assign every surface a small portion of a lightmap texture and modulate it with you base texture. You reuse your resources, and unique resources for surface or objects are small. For a normal wall you maybe get a 16x16 lightmap area. In the shader enabled world you store a small bunch of constants or vertex attributes that describes the properties of that wall. You don't assign a different shader because your other wall has a blue tint and this wall is green. No, you pass the color to the shader.
It's not about reducing quality. It's about sensible use of the API and hardware.