Diffuse transfer function
In PRT, transfer function includes much information(visibility, intereflected lighting) and projected to sh coefficients in offline using monte carlo integration. But many game engine uses sh lighting without these pre-computed transfer function. For example, characters usually don’t contain visibility data for each vertex or texture. So we have to do lighting with only surface normal and lighting function. Because we don’t have pre-computed transfer function, Lambert(clamped cosine) function like below image will be used.
Maybe you might have wondered how this Lambert transfer function could be generated in runtime. Ok, Cosine function could be projected to sh coefficients using monte carlo integration. But transfer function should be different for specific surface normal. How could this transfer function be rotated along surface normal vector? The famous R.Ramanmoorthi’s IrradianceEnvironmentMap paper lacks detail explanation for this process.
Irradiance Convolution
The convenient Irradiance convolution is like this.
is lighting function,
is transfer function,
Then irradiance E is,
Analytic diffuse transfer function
In this paper, You can learn how cosine function is projected to sh coefficients analytically. Note that this function is in local coordinate.
Local? World? coordinate
The analytic cosine function above is in local coordinate. It means that you can use it with surfaces whose normal vector is z axis. So you have to rotate this along surface normal vector.
Rotation of clamped cosine function(Zonal harmonics rotation)
When is direction to which we want to rotate,
is rotated cosine function along ,
is original cosine function along z axis,
When is 1, and , and other coefficients match as well.
So in conclusion you just need to use this coefficients to rotate diffuse transfer function. And you can use this resulting coefficient to do dot product with lighting coefficients as R.Ramanmoorthi’s IrradianceEnvironmentMap paper says.
Other BRDF
Most game engine uses same diffuse transfer function like above even the diffuse BRDF of surface is not Lambert, therefore indirect lighting for BRDF other than lambert is not realistic. But with knowledge like this we could do better. The Order 1886 generated skin diffuse transfer function which is projected by monte carlo integration and used it as skin diffuse lighting. If we have other isotropic diffuse BRDF function we could do exactly same thing like this.