For normalization purposes, how to "extract" a BRDF function from an ad-hoc piece of pixel shading code ?
If we have a shader function like:
float4 MyShadingFunction(float3 incomingLightDirection, float incomingRadiance)
{
float4 lightContributionToPixelColor;
// ...
// several complicated formulas (to which we have access)
// ...
return lightContributionToPixelColor;
}
What is the procedure to translate the "complicated formulas" into a BRDF function f that can then be mathematically integrated ?
