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-02-08 14:51:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-08 15:21:22 +0300
commit813800f143b90480f563d1e1dd6fbb9acd3e5f87 (patch)
tree43f152dd81ae17d5dd1cb5ee9407e892543808f3 /source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl
parentd723249dcc20ff6fab55d443dba85203a104a7fc (diff)
DRW: support clipping for stick & wire bones
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl
index 7db7e28d8e6..d4e6f697936 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl
@@ -1,5 +1,8 @@
uniform mat4 ModelViewProjectionMatrix;
+#ifdef USE_WORLD_CLIP_PLANES
+uniform mat4 ModelMatrix;
+#endif
in vec3 pos;
#if defined(USE_COLOR_U32)
@@ -12,7 +15,8 @@ flat out vec4 finalColor;
void main()
{
- gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
+ vec4 pos_4d = vec4(pos, 1.0);
+ gl_Position = ModelViewProjectionMatrix * pos_4d;
#if defined(USE_COLOR_U32)
finalColor = vec4(
@@ -23,4 +27,8 @@ void main()
#else
finalColor = color;
#endif
+
+#ifdef USE_WORLD_CLIP_PLANES
+ world_clip_planes_calc_clip_distance((ModelMatrix * pos_4d).xyz);
+#endif
}