How to use a few shading functions together with deferred rendering (for example some objects are shaded based on a lighting equation, other get a fixed color) ? I draw a full screen quad when shading (later I want to add optimizations for point lights). I have some idea how to solve that problem: during a gbuffer stage a shading function id should be saved in one of the render targets. Then we can do something like this:
if(id == 0)
{
fragColor = shadingFun0(...);
}
else
{
fragColor = shadingFun1(...);
}
What do you think about that ?