Fix T100377: EEVEE: Regression 3.2 normalmap node broken

This was caused by un-wanted normalization. This is a requirement of
the MikkTspace. The issue is that g_data.N is expected to be normalized
by many other functions and overriden by bump displacement.

Adding a new global variable containing the interpolated normal fixes the
issue AND make it match cycles behavior better (mix between bump and
interpolated normal).
This commit is contained in:
Clément Foucault
2022-09-02 18:13:54 +02:00
parent 874e9cbab9
commit 07cf3ce92f
4 changed files with 11 additions and 7 deletions

View File

@@ -187,8 +187,10 @@ struct ClosureTransparency {
struct GlobalData {
/** World position. */
vec3 P;
/** Surface Normal. */
/** Surface Normal. Normalized, overriden by bump displacement. */
vec3 N;
/** Raw interpolated normal (non-normalized) data. */
vec3 Ni;
/** Geometric Normal. */
vec3 Ng;
/** Curve Tangent Space. */