diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl index ebc945fcf35..f39c10e8310 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl @@ -1,12 +1,16 @@ uniform mat4 ModelViewProjectionMatrix; +#ifdef USE_WORLD_CLIP_PLANES +uniform mat4 ModelMatrix; +#endif uniform float size; in vec3 pos; out vec2 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 @@ -18,4 +22,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 } |