Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-03-16 00:28:18 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-03-16 00:33:03 +0300
commit86646dab7c455e739e5d648d0857bf30fd81afb9 (patch)
tree143b53b52edc9c43be771a0f6320f9b86b6ef237 /source/blender/draw/engines
parent1d6009d7aab8a29a084abaee3ed37fac1f3e800c (diff)
Fix T62621 object scale changes tangent node output in Eevee
Normal Matrices were not normalized, leading to non-normalized vector rotations results.
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/shadow_vert.glsl4
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl b/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl
index ef7213cd21e..5438da1c007 100644
--- a/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl
@@ -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 = normalize(WorldNormalMatrix * nor);
- viewNormal = normalize(NormalMatrix * nor);
+ worldNormal = WorldNormalMatrix * nor;
+ viewNormal = NormalMatrix * nor;
#endif
/* Used for planar reflections */
diff --git a/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl b/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
index 2583c7c8765..a014135742f 100644
--- a/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
+++ b/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
@@ -24,8 +24,8 @@ void main() {
#ifdef MESH_SHADER
viewPosition = (ModelViewMatrix * vec4(pos, 1.0)).xyz;
worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz;
- viewNormal = normalize(NormalMatrix * nor);
- worldNormal = normalize(WorldNormalMatrix * nor);
+ viewNormal = NormalMatrix * nor;
+ worldNormal = WorldNormalMatrix * nor;
#ifdef USE_ATTR
pass_attr(pos);
#endif