-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add energy compensation #198
Comments
Original (?) source of discussion https://eheitzresearch.wordpress.com/240-2/ Excellent explanation of math https://patapom.com/blog/BRDF/MSBRDFEnergyCompensation/ ThreeJS PR mrdoob/three.js#15644 Filament implementation https://google.github.io/filament/Filament.md.html#materialsystem/improvingthebrdfs/energylossinspecularreflectance |
There is some work done here #331 |
A Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting // GLSL code for dielectrics
// Common code for single and multiple scattering
// Roughness dependent fresnel
vec3 Fr = max(vec3(1.0 - roughness), F0) - F0; vec3 kS = F0 + Fr * pow(1.0-ndv, 5.0);
vec2 f_ab = textureLod(uEnvBRDF, vec2(ndv, roughness), 0).xy;
vec3 FssEss = kS * f_ab.x + f_ab.y;
float lodLevel = roughness * numEnvLevels;
vec3 reflDir = reflect(-eye, normal);
// Prefiltered radiance
vec3 radiance = getRadiance(reflDir, lodLevel);
// Cosine-weighted irradiance
vec3 irradiance = getIrradiance(normal);
// Multiple scattering
float Ess = f_ab.x + f_ab.y;
float Ems = 1-Ess;
vec3 Favg = F0 + (1-F0)/21;
vec3 Fms = FssEss*Favg/(1-(1-Ess)*Favg);
// Dielectrics
vec3 Edss = 1 - (FssEss + Fms * Ems); vec3 kD = albedo * Edss;
// Composition
return FssEss * radiance + (Fms*Ems+kD) * irradiance; |
Hasn't that been implemented already? Or is it only in some experiment? |
No description provided.
The text was updated successfully, but these errors were encountered: