From 9bc43223c109c413601eded1309963f3f4ec2568 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Jan 2019 00:13:42 +1100 Subject: DRW: support clipping for object & lamp centers --- .../gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl') diff --git a/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl index 0d6b90cfba4..e14032a9694 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl @@ -1,5 +1,8 @@ uniform mat4 ModelViewProjectionMatrix; +#ifdef USE_WORLD_CLIP_PLANES +uniform mat4 ModelMatrix; +#endif uniform float size; uniform float outlineWidth; @@ -7,7 +10,8 @@ in vec3 pos; out vec4 radii; void main() { - gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); + vec4 pos_4d = vec4(pos, 1.0); + gl_Position = ModelViewProjectionMatrix * pos_4d; gl_PointSize = size; // calculate concentric radii in pixels @@ -21,4 +25,8 @@ void main() { // convert to PointCoord units radii /= size; + +#ifdef USE_WORLD_CLIP_PLANES + world_clip_planes_calc_clip_distance((ModelMatrix * pos_4d).xyz); +#endif } -- cgit v1.2.3