Hey guys,
I know there were a lot of talks about this topic, but there are still some things I don't really understand.
My goal is to implement Image based lighting and physically based shading.
To do this I have to solve the lighting integral.
I am following the Epic Games course notes, but one thing bothers me:
They apply a ME to the equation using Importance sampling. So far so good.
Then they split the sum into two sums and multiply them together so they can be precomputed. This is an approximation however.
Why can't you just calculate so that you end up with:
[attachment=33361:CodeCogsEqn.gif]
(Essentially splitting the integral around the sum.)
The first Integral can be precalculated with Spherical harmonics (to which I have a question too, but I might ask that in another post) and is exactly the same as in Epic's presentation.
The second Integral differs from Epic's course notes in that it has Li(l) in it. But that shouldn't be a problem because fspec depends on l too, so it doesn't add up to the dependency count.
In the fragment shader you just look up both textures with the appropriate values and add them together.
Can somebody please help me who had only experience with Phong shaders and OpenGL 2.0 in the past? I don't seem to understand and why it seems so complicated in my eyes.
Thank you very much. DaOnlyOwner