diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-09-02 19:13:54 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-09-02 19:13:54 +0300 |
commit | 07cf3ce92fa257a0cac5565ca1ff857834ce67ce (patch) | |
tree | 3d73216d1c2a12497423c62902815b0e775f0ea7 /source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl | |
parent | 874e9cbab9fbd65220794cebc195e5e28786ad78 (diff) |
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).
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl b/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl index 6091a5c834a..c0821085c8d 100644 --- a/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl +++ b/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl @@ -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. */ |