Revert "Fix T62621 object scale changes tangent node output in Eevee"
authorClément Foucault <foucault.clem@gmail.com>
Thu, 21 Mar 2019 22:30:24 +0000 (23:30 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Thu, 21 Mar 2019 23:13:18 +0000 (00:13 +0100)
This reverts commit 86646dab7c455e739e5d648d0857bf30fd81afb9.

source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl
source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
source/blender/draw/intern/draw_manager_exec.c

index 5438da1..ef7213c 100644 (file)
@@ -66,8 +66,8 @@ void main()
        gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
        viewPosition = (ModelViewMatrix * vec4(pos, 1.0)).xyz;
        worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz;
-       worldNormal = WorldNormalMatrix * nor;
-       viewNormal = NormalMatrix * nor;
+       worldNormal = normalize(WorldNormalMatrix * nor);
+       viewNormal = normalize(NormalMatrix * nor);
 #endif
 
        /* Used for planar reflections */
index a014135..2583c7c 100644 (file)
@@ -24,8 +24,8 @@ void main() {
 #ifdef MESH_SHADER
        viewPosition = (ModelViewMatrix * vec4(pos, 1.0)).xyz;
        worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz;
-       viewNormal = NormalMatrix * nor;
-       worldNormal = WorldNormalMatrix * nor;
+       viewNormal = normalize(NormalMatrix * nor);
+       worldNormal = normalize(WorldNormalMatrix * nor);
 #ifdef USE_ATTR
        pass_attr(pos);
 #endif
index 89dcb01..dbbc847 100644 (file)
@@ -803,7 +803,6 @@ static void draw_matrices_model_prepare(DRWCallState *st)
                copy_m3_m4(st->normalview, st->modelview);
                invert_m3(st->normalview);
                transpose_m3(st->normalview);
-               normalize_m3(st->normalview);
        }
        if (st->matflag & DRW_CALL_EYEVEC) {
                /* Used by orthographic wires */
@@ -822,7 +821,6 @@ static void draw_matrices_model_prepare(DRWCallState *st)
                copy_m3_m4(st->normalworld, st->model);
                invert_m3(st->normalworld);
                transpose_m3(st->normalworld);
-               normalize_m3(st->normalworld);
                st->matflag &= ~DRW_CALL_NORMALWORLD;
        }
 }