   float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);
   vec3 specularEnvironmentR0 = specularColor.rgb;
   vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;
-  float alphaG = roughness*roughness+0.0005;
+
+  // roughness is perceptual roughness; alpha is material roughness
+  float alpha = roughness*roughness;
 
   PBRInfo pbrInputs = PBRInfo(
     NdotL,

// implementation of microfacet occlusion from “An Inexpensive BRDF Model for Physically based Rendering” by Christophe Schlick
float geometricOcclusionSchlick(PBRInfo pbrInputs)
{
  float k = pbrInputs.roughness * 0.79788; // 0.79788 = sqrt(2.0/3.1415);
  // alternately, k can be defined with
  // float k = (pbrInputs.roughness + 1)*(pbrInputs.roughness + 1)/8;


{
  float NdotL2 = pbrInputs.NdotL * pbrInputs.NdotL;
  float NdotV2 = pbrInputs.NdotV * pbrInputs.NdotV;
  float v = ( -1. + sqrt ( pbrInputs.alpha * (1. - NdotL2 ) / NdotL2 + 1.)) * 0.5;
  float l = ( -1. + sqrt ( pbrInputs.alpha * (1. - NdotV2 ) / NdotV2 + 1.)) * 0.5;
  return (1. / max((1. + v + l ),0.000001));
}

