5

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 ?

For example to use f in an expression such as:
enter image description here

wip
  • 1,851
  • 1
  • 13
  • 26
  • 3
    I think this question is too broad. In the end your formula will boil down to a sum of some terms that depend on some input (e.g. normals, light data etc.). The procedure is basically rewriting the calculation code as formulas. There is no special rendering magic there. If you can get any more specific, please add details to the question. – David Kuri Sep 25 '15 at 08:51

0 Answers0