SL-17763: PBR: Fix ems calculation

meow-7.2.2
Ptolemy 2022-08-02 19:39:37 -07:00
parent 4ffe2d74db
commit 1a9d167740
1 changed files with 1 additions and 4 deletions

View File

@ -306,10 +306,7 @@ void main()
// Reference: getIBLRadianceLambertian
vec3 FssEssLambert = specWeight * kSpec * vScaleBias.x + vScaleBias.y; // NOTE: Very similar to FssEssRadiance but with extra specWeight term
float Ems = (1.0 - vScaleBias.x + vScaleBias.y);
#if PBR_USE_GGX_EMS_HACK
Ems = alphaRough; // With GGX approximation Ems = 0 so use substitute
#endif
float Ems = 1.0 - (vScaleBias.x + vScaleBias.y);
vec3 avg = specWeight * (reflect0 + (1.0 - reflect0) / 21.0);
vec3 AvgEms = avg * Ems;
vec3 FmsEms = AvgEms * FssEssLambert / (1.0 - AvgEms);