message: minor code and comments cleanups in dfg computations
  also added uniform hemisphere sampling function for reference.
diff: @@ -37,7 +37,7 @@ static double pow5(double x) {
  return (x*x)*(x*x)*x;
  }
  -static double3 hemisphereImportanceSampleDggx(double2 u, double a) {
  +static double3 hemisphereImportanceSampleDggx(double2 u, double a) { // pdf = D(a) * cosTheta
  const double phi = 2 * M_PI * u.x;
  // NOTE: (aa-1) == (a-1)(a+1) produces better fp accuracy
  const double cosTheta2 = (1 - u.y) / (1 + (a + 1) * ((a - 1) * u.y));
  @@ -46,7 +46,7 @@ static double3 hemisphereImportanceSampleDggx(double2 u, double a) {
  return { sinTheta * std::cos(phi), sinTheta * std::sin(phi), cosTheta };
  }
  -static double3 __UNUSED hemisphereCosSample(double2 u) {
  +static double3 __UNUSED hemisphereCosSample(double2 u) { // pdf = cosTheta / M_PI;
  const double phi = 2 * M_PI * u.x;
  const double cosTheta2 = 1 - u.y;
  const double cosTheta = std::sqrt(cosTheta2);
  @@ -54,6 +54,13 @@ static double3 __UNUSED hemisphereCosSample(double2 u) {
  return { sinTheta * std::cos(phi), sinTheta * std::sin(phi), cosTheta };
  }
  +static double3 __UNUSED hemisphereUniformSample(double2 u) { // pdf = 1.0 / (2.0 * M_PI);
  + const double phi = 2 * M_PI * u.x;
  + const double cosTheta = 1 - u.y;
  + const double sinTheta = std::sqrt(1 - cosTheta * cosTheta);
  + return { sinTheta * std::cos(phi), sinTheta * std::sin(phi), cosTheta };
  +}
  +
  static double DistributionGGX(double NoH, double linearRoughness) {
  // NOTE: (aa-1) == (a-1)(a+1) produces better fp accuracy
  double a = linearRoughness;
  @@ -557,14 +564,16 @@ static double2 __UNUSED DFV_NoIS(double NoV, double roughness, size_t numSamples
  const double NoH = saturate(H.z);
  if (NoL > 0) {
  // Note: remember VoH == LoH (H is half vector)
  - const double v = Visibility(NoV, NoL, linearRoughness) * NoL * (VoH / NoH);
  + const double J = 1.0 / (4.0 * VoH);
  + const double pdf = NoH / M_PI;
  + const double d = DistributionGGX(NoH, linearRoughness) * NoL / (pdf * J);
  const double Fc = pow5(1 - VoH);
  - const double d = DistributionGGX(NoH, linearRoughness);
  + const double v = Visibility(NoV, NoL, linearRoughness);
  r.x += d * v * (1.0 - Fc);
  r.y += d * v * Fc;
  }
  }
  - return r * (M_PI * 4.0 / numSamples);
  + return r / numSamples;
  }
  /*
  