Fix: EEVEE-Next: Wrong thickness for Hybrid material

The thickness was evaluated after the surface nodetree.
So the effective thickness for shader to RGB BSDFs was
undefined.

Fix #120791
This commit is contained in:
Clément Foucault
2024-05-10 12:27:46 +02:00
parent 10c677ba91
commit 5a76ba9892

View File

@@ -44,14 +44,14 @@ void main()
float noise = utility_tx_fetch(utility_tx, gl_FragCoord.xy, UTIL_BLUE_NOISE_LAYER).r;
float closure_rand = fract(noise + sampling_rng_1D_get(SAMPLING_CLOSURE));
g_thickness = nodetree_thickness() * thickness_mode;
fragment_displacement();
nodetree_surface(closure_rand);
g_holdout = saturate(g_holdout);
g_thickness = nodetree_thickness() * thickness_mode;
/** Transparency weight is already applied through dithering, remove it from other closures. */
float transparency = 1.0 - average(g_transmittance);
float transparency_rcp = safe_rcp(transparency);