pex-renderer icon indicating copy to clipboard operation
pex-renderer copied to clipboard

Evaluate burley diffuse

Open dmnsgn opened this issue 6 years ago • 2 comments

dmnsgn avatar Apr 26 '19 14:04 dmnsgn

Possible implementations

Urho3d

vec3 BurleyDiffuse(vec3 diffuseColor, float roughness, float NdotV, float NdotL, float VdotH) {
  float energyBias = mix(roughness, 0.0, 0.5);
  float energyFactor = mix(roughness, 1.0, 1.0 / 1.51);
  float fd90 = energyBias + 2.0 * VdotH * VdotH * roughness;
  float f0 = 1.0;
  float lightScatter = f0 + (fd90 - f0) * pow(1.0 - NdotL, 5.0);
  float viewScatter = f0 + (fd90 - f0) * pow(1.0 - NdotV, 5.0);

  return diffuseColor * lightScatter * viewScatter * energyFactor;
}

Filament

float Fd_Burley(float NoV, float NoL, float LoH, float roughness) {
    float f90 = 0.5 + 2.0 * roughness * LoH * LoH;
    float lightScatter = F_Schlick(NoL, 1.0, f90);
    float viewScatter = F_Schlick(NoV, 1.0, f90);
    return lightScatter * viewScatter * (1.0 / PI);
}

vorg avatar Sep 10 '19 13:09 vorg