EEVEE: Fix wrong sss component being affected by alpha

This fixes NaNs / blown up values when using alpha-hashed transparency
or alpha clip with SSS.
This commit is contained in:
2021-03-13 16:58:44 +01:00
parent 267a9e14f5
commit 165a2da753
2 changed files with 2 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ void main()
#endif
#ifndef USE_ALPHA_BLEND
float alpha_div = 1.0 / max(1e-8, alpha);
float alpha_div = safe_rcp(alpha);
outRadiance.rgb *= alpha_div;
ssrData.rgb *= alpha_div;
# ifdef USE_SSS

View File

@@ -193,7 +193,7 @@ void node_bsdf_principled(vec4 base_color,
result.radiance *= alpha;
result.ssr_data.rgb *= alpha;
# ifdef USE_SSS
result.sss_irradiance *= alpha;
result.sss_albedo *= alpha;
# endif
}