   float blinnExponent = GGXRoughnessToBlinnExponent(material.specularRoughness);
   vec3 irradiance = getLightProbeIndirectIrradiance(geometry.normal, blinnExponent, 8);
   // irradiance = getLightProbeIndirectIrradianceSH(geometry.normal);
-  RE_IndirectDiffuse(irradiance, geometry, material, reflectedLight);
-  
   vec3 radiance = getLightProbeIndirectRadiance(geometry.viewDir, geometry.normal, blinnExponent, 8);
-  RE_IndirectSpecular(radiance, geometry, material, reflectedLight);
-  
+  RE_Indirect(irradiance, radiance, geometry, material, reflectedLight);
+
   vec3 outgoingLight = emissive + reflectedLight.directDiffuse + reflectedLight.directSpecular + reflectedLight.indirectDiffuse + reflectedLight.indirectSpecular;
 
   // outgoingLight = vec3(clearCoat);

  material.specularRoughness = max(material.specularRoughness, material.clearCoatRoughness);
  material.linearRoughness = material.specularRoughness * material.specularRoughness;
  

  material.specularColor = mix(material.specularColor,
    f0ClearCoatToSurface(material.specularColor), clearCoat);


  return GammaToLinear(textureCubeLodEXT(radianceMap, queryVec, specMipLevel), float(GAMMA_FACTOR)).rgb;
}

void RE_Indirect(const in vec3 irradiance, const in vec3 radiance, 
  const in GeometricContext geometry, const in Material material, inout ReflectedLight reflectedLight) {

  vec3 Fd = irradiance * DiffuseBRDF(material.diffuseColor) * indirectDiffuseIntensity;
  vec3 Fr = radiance * EnvBRDFApprox(material.specularColor, material.specularRoughness, material.dotNV);

  // The clear coat layer assumes an IOR of 1.5 (4% reflectance)
  float Fc = F_SchlickF(0.04, 1.0, material.dotNV) * clearCoat;
  float attenuation = 1.0 - Fc;
  float attenuation2 = attenuation*attenuation;
  Fr *= attenuation2;
  Fr += radiance * EnvBRDFApprox(material.specularColor, material.clearCoatRoughness, material.dotNV) * Fc;
  Fd *= attenuation;

  Fd *= indirectDiffuseIntensity;
  Fr *= indirectSpecularIntensity;

  reflectedLight.indirectDiffuse  += Fd;
  reflectedLight.indirectSpecular += Fr;
}

//-------------------------------------------------------------------------
