Any way my real question is this. Lets say I want to implement a deferred shading renderer that stores a material ID in the gbuffer and applies different BDRFs based on that ID. What kind of performance difference, if any, would I likely see implementing it in these ways:
switch(matID)
{
case 0:
return BlinnPhongBRDF(NdotL, NdotE);
break;
case 1:
return AnisotropicBRDF(NdotL, NdotE);
break
...
}
vs.
interface BRDF
{
float4 CalculateLighting(float NdotL, float NdotE);
};
...
return BRDFArray[matID].CalculateLighting(NdotL, NdotE);







