diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-28 16:13:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-28 16:27:43 +0300 |
commit | 9bc43223c109c413601eded1309963f3f4ec2568 (patch) | |
tree | e43076e55a9a5e673c6830e447afdd47f32f5b8b /source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl | |
parent | 20acf3ded27671c9f564cbfe00ad36a313a51f3e (diff) |
DRW: support clipping for object & lamp centers
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl | 10 |
1 files changed, 9 insertions, 1 deletions
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 } |