Jump to content
  • Advertisement
Sign in to follow this  
Alundra

Schlick vis factor

This topic is 1077 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

Here the current vis factor I'm using based on an old discussion about PBR :

// [Schlick 1994, "An Inexpensive BRDF Model for Physically-Based Rendering"].
float SchlickFunc( in float v, in float m )
{
  float k = sqrt( ( 2.0f * m * m ) / 3.14159f );
  return v / ( v - ( k * v ) + k );
}

// [Schlick 1994, "An Inexpensive BRDF Model for Physically-Based Rendering"].
float G_Schlick( in float Roughness, in float NoV, in float NoL )
{
  return SchlickFunc( NoL, Roughness ) * SchlickFunc( NoV, Roughness );
}

But I saw unreal uses :

// Tuned to match behavior of Vis_Smith
// [Schlick 1994, "An Inexpensive BRDF Model for Physically-Based Rendering"]
float Vis_Schlick( float Roughness, float NoV, float NoL )
{
  float k = Square( Roughness ) * 0.5;
  float Vis_SchlickV = NoV * (1 - k) + k;
  float Vis_SchlickL = NoL * (1 - k) + k;
  return 0.25 / ( Vis_SchlickV * Vis_SchlickL );
}

Where comes from this calcule ? As you can see, the pi factor is not there, sqrt also.

Here the formula used by John Hable :

float G1V(float dotNV, float k)
{
  return 1.0f/(dotNV*(1.0f-k)+k);
}

// V
float alpha = roughness*roughness;
float k = alpha/2.0f;
vis = G1V(dotNL,k)*G1V(dotNV,k);

Again, not the same formula and again pi and sqrt not there.

What is the explanation of all these different formula ? The unreal one is the most mysterious to me.

Thanks

--

The other factors used are common :

float3 Diffuse_Lambert( float3 DiffuseColor )
{
  return DiffuseColor * (1 / PI);
}
// GGX / Trowbridge-Reitz
// [Walter et al. 2007, "Microfacet models for refraction through rough surfaces"]
float D_GGX( float Roughness, float NoH )
{
  float m = Roughness * Roughness;
  float m2 = m * m;
  float d = ( NoH * m2 - NoH ) * NoH + 1; // 2 mad
  return m2 / ( PI*d*d ); // 4 mul, 1 rcp
}
// [Schlick 1994, "An Inexpensive BRDF Model for Physically-Based Rendering"]
// [Lagarde 2012, "Spherical Gaussian approximation for Blinn-Phong, Phong and Fresnel"]
float3 F_Schlick( float3 SpecularColor, float VoH )
{
  // Anything less than 2% is physically impossible and is instead considered to be shadowing
  float Fc = pow( 1 - VoH, 5 ); // 1 sub, 3 mul
  return saturate( 50.0 * SpecularColor.g ) * Fc + (1 - Fc) * SpecularColor;
}
Edited by Alundra

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!