Here's the problem: I'd prefer to use deferred rendering, however, I'd also like to support multiple shading models (strauss, ward, ashikhmin-shirley, etc). The necessary data (position, normal, diffuse, material, etc) is output to various textures which, as standard, is read by a shader that creates the final picture.
Right now, I would have to switch on the material type in this shader and use the appropriate formulas to get the result, though I've read that heavy branching like this should be avoided (and for legitimate reasons). What's the standard solution here?
Also, how should ambient lighting be calculated in a scene for non-blinn phong shading models? Normally you could just leverage the mesh's diffuse texture to trivially set a base "lit" value, but this won't work for shading models that are drastically different (as parts of the mesh that are lit dynamically will look very different from those that are just lit by ambient lighting).