[Bf-blender-cvs] [76634a23bbf] master: Fix T63729 Eevee: Bump does not follow normal direction

Clément Foucault noreply at git.blender.org
Thu Jun 6 22:26:45 CEST 2019


Commit: 76634a23bbf70e4b0be8fecfd6782820a856b5a7
Author: Clément Foucault
Date:   Thu Jun 6 19:32:43 2019 +0200
Branches: master
https://developer.blender.org/rB76634a23bbf70e4b0be8fecfd6782820a856b5a7

Fix T63729 Eevee: Bump does not follow normal direction

===================================================================

M	source/blender/gpu/shaders/gpu_shader_material.glsl

===================================================================

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 0840c704f3f..4135151050e 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -3376,7 +3376,7 @@ void node_bump(
     float strength, float dist, float height, vec3 N, vec3 surf_pos, float invert, out vec3 result)
 {
   N = mat3(ViewMatrix) * normalize(N);
-  dist *= invert;
+  dist *= gl_FrontFacing ? invert : -invert;
 
   vec3 dPdx = dFdx(surf_pos);
   vec3 dPdy = dFdy(surf_pos);



More information about the Bf-blender-cvs mailing list