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:
authorCampbell Barton <ideasman42@gmail.com>2019-01-21 07:57:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-21 08:15:30 +0300
commit07673a3460cd0dc37aa9435ade76fabbc78d2c1e (patch)
tree30da135f129ac99219c3a1f71f673c440e6bb268 /source/blender/draw/modes/shaders/edit_normals_vert.glsl
parentdd3f5186260eddc2c115b560bb832baff0f108ae (diff)
DRW: Support edit-mesh clipping
Diffstat (limited to 'source/blender/draw/modes/shaders/edit_normals_vert.glsl')
-rw-r--r--source/blender/draw/modes/shaders/edit_normals_vert.glsl7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/edit_normals_vert.glsl b/source/blender/draw/modes/shaders/edit_normals_vert.glsl
index 3ce7e618511..edca278fa8b 100644
--- a/source/blender/draw/modes/shaders/edit_normals_vert.glsl
+++ b/source/blender/draw/modes/shaders/edit_normals_vert.glsl
@@ -2,9 +2,13 @@
uniform mat4 ModelViewProjectionMatrix;
uniform mat3 NormalMatrix;
uniform mat4 ProjectionMatrix;
+uniform mat4 ModelMatrix;
uniform float normalSize;
in vec3 pos;
+#ifdef USE_WORLD_CLIP_PLANES
+flat out vec3 wsPos;
+#endif
#ifdef LOOP_NORMALS
in vec3 lnor;
@@ -27,4 +31,7 @@ void main()
v1 = ModelViewProjectionMatrix * vec4(pos, 1.0);
vec3 n = normalize(NormalMatrix * nor); /* viewspace */
v2 = v1 + ProjectionMatrix * vec4(n * normalSize, 0.0);
+#ifdef USE_WORLD_CLIP_PLANES
+ wsPos = (ModelMatrix * vec4(pos, 1.0)).xyz;
+#endif
}