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-24 10:27:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-24 10:28:21 +0300
commitaa1b77dccbda5b57f857d27ed8f7d46544c82503 (patch)
treecccdb399a80f1a153604583549bc0d9061b5a060 /source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl
parent0b37399cbe241cb6c99cd4b758d5701e2791c7e3 (diff)
DRW: support clipping for object outlines
Diffstat (limited to 'source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl')
-rw-r--r--source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl b/source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl
index ba824a7c007..744bf0ff1e3 100644
--- a/source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl
+++ b/source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl
@@ -1,6 +1,7 @@
uniform mat4 ModelViewMatrix;
uniform mat4 ModelViewProjectionMatrix;
+uniform mat4 ModelMatrix;
in vec3 pos;
@@ -13,4 +14,8 @@ void main()
pPos = ModelViewProjectionMatrix * vec4(pos, 1.0);
/* Small bias to always be on top of the geom. */
pPos.z -= 1e-3;
+
+#ifdef USE_WORLD_CLIP_PLANES
+ world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz);
+#endif
}