Hi,
We always removed PI in lighting equations, artist who set 1.0 in reality set PI.
Is it really needed to add PI in the lighting equation which cause the intensity of light to be PI times less than before ?
Here code without PI :
float3 Diffuse_Lambert( in float3 DiffuseColor )
{
return DiffuseColor;
}
// [Walter et al. 2007, "Microfacet models for refraction through rough surfaces"].
float D_GGX( in float Roughness, in float NoH )
{
float m = Roughness * Roughness;
float m2 = m * m;
float d = ( NoH * m2 - NoH ) * NoH + 1.0f;
return m2 / ( d * d );
}
Here code with PI :
float3 Diffuse_Lambert( in float3 DiffuseColor )
{
return DiffuseColor * ( 1.0f / 3.14159f );
}
// [Walter et al. 2007, "Microfacet models for refraction through rough surfaces"].
float D_GGX( in float Roughness, in float NoH )
{
float m = Roughness * Roughness;
float m2 = m * m;
float d = ( NoH * m2 - NoH ) * NoH + 1.0f;
return m2 / ( 3.14159f * d * d );
}