Great! Incorporating energy compensation into your SSR + diffuse GI blending setup can make your approximated specular irrandiance more physically plausible and visually coherent. This is especially important because substituting rough specular reflection with diffuse irradiance risks underestimating or misrepresenting reflection energy and angular dependence (Fresnel effect).
Quick recap of the situation:
- You approximate rough specular irradiance with diffuse GI.
- You blend
SSR (sharp specular) and diffuse irradiance based on roughness.
- You want to compensate for the energy mismatch so it looks more “correct”.
Key physical factors to consider for energy compensation
1. Fresnel Effect (angle dependence)
Specular reflection intensity depends on the angle between view vector and surface normal (N·V) — specular reflectance increases towards grazing angles. Since your diffuse irradiance is view-independent and isotropic, it lacks this angular flick.
2. Scaling for energy conservation between diffuse and specular lobes
In microfacet BRDF models (e.g., Cook-Torrance), energy is split between diffuse and specular lobes depending on metallic and roughness, with Fresnel and normal distribution functions controlling relative strength.
How to compensate energy in your approximation
(A) Add simple Fresnel factor modulation to the diffuse GI term used as rough specular:
Use the Schlick Fresnel approximation:
// Schlick's approximation of Fresnel reflectance at view angle
vec3 F0 = mix(vec3(0.04), baseColor.rgb, metallic); // base reflectivity, non-metal=~0.04
float NdotV = max(dot(normal, viewDir), 0.0);
vec3 fresnel = F0 + (vec3(1.0) - F0) * pow(1.0 - NdotV, 5.0);
Multiply your diffuse irradiance approximation for rough specular by fresnel, boosting reflection energy at grazing angles.
(B) Apply a roughness-dependent specular energy scale
Since the rough specular lobe is being approximated by diffuse irradiance (which is lower energy on average than specular):
- You can increase intensity proportional to
(1 - roughness * some_scale)
A common choice:
float specularEnergyCompensation = 1.0 + 2.0 * (1.0 - roughness);
// Or tweak the constant factor to taste
Multiply your rough specular term with this factor to brighten rough reflections somewhat, because diffuse GI is generally dimmer than physical rough specular.
(C) Reduce diffuse lambert irradiance to avoid double counting energy (optional):
Since brightening the rough specular term might increase total reflected energy, adjust the diffuse BRDF accordingly, e.g.:
vec3 diffuseTerm = (1.0 - metal) * diffuseIrradiance * (1.0 - fresnelAverage);
where fresnelAverage can be approximated or integrated Fresnel reflectance over the hemisphere, known for dielectric around 0.04, for metal depends on baseColor.
But this is more advanced; often you don’t modify diffuse unless you want very strict energy conservation.
Putting it together (pseudocode):
vec3 F0 = mix(vec3(0.04), baseColor.rgb, metallic);
float NdotV = max(dot(normal, viewDir), 0.0);
vec3 fresnel = F0 + (vec3(1.0) - F0) * pow(1.0 - NdotV, 5.0);
float specularEnergyComp = 1.0 + 2.0 * (1.0 - roughness);
vec3 specularSSR = sampleSSR(...); // SSR specular (for low roughness)
vec3 diffuseIrradiance = sampleDiffuseSH(...); // Diffuse GI
float specularBlend = 1.0 - roughness;
vec3 roughSpecularApprox = diffuseIrradiance * fresnel * specularEnergyComp;
vec3 specular = mix(roughSpecularApprox, specularSSR, specularBlend) * metallic;
Notes:
- If
specularEnergyComp is too large, reflections look “glowing” — tune by eye.
- Fresnel modulation adds believable angular dependence missing from diffuse GI.
- This approach gives you a plausible energy curve without prefiltering environment maps.
- You may cache or precalculate constants or average Fresnel terms if performance is critical.
Bonus: Why not always use environment maps for rough specular?
Remember that prefiltered environment maps already store roughness-dependent blurring and correct average energy, so they typically do not need explicit Fresnel modulation or energy compensation at sample time since it’s baked in by convolution.
Your approach only needs this because you approximate rough specular with diffuse GI.
If you want, I can also help you with sample GLSL or HLSL code or suggest good parameter ranges to start your tuning! Would that be helpful?