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-05-09 17:16:12 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-10 13:14:41 +0300
commita298dde5d799bd41dd571cda9c91b62a6b78562a (patch)
tree75dc46e668c58915e0a2f1a8369f2a029e42072c /source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
parentfdddea676d4fa40668ca82f8ccc5106437d113f2 (diff)
Eevee: Update matrices operations to not use combined matrices
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/shadow_vert.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/shadow_vert.glsl13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl b/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
index baaa43d84b8..4f59725fcf8 100644
--- a/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
+++ b/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
@@ -1,10 +1,6 @@
-uniform mat4 ModelViewProjectionMatrix;
-#ifdef MESH_SHADER
-uniform mat4 ModelViewMatrix;
-# ifndef USE_ATTR
+#ifndef USE_ATTR
uniform mat4 ModelMatrix;
-# endif
#endif
in vec3 pos;
@@ -19,10 +15,11 @@ out vec3 viewNormal;
void main()
{
- gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
+ vec3 world_pos = point_object_to_world(pos);
+ gl_Position = point_world_to_ndc(world_pos);
#ifdef MESH_SHADER
- viewPosition = (ModelViewMatrix * vec4(pos, 1.0)).xyz;
- worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz;
+ worldPosition = world_pos;
+ viewPosition = point_world_to_view(worldPosition);
worldNormal = normalize(normal_object_to_world(nor));
/* No need to normalize since this is just a rotation. */