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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user