diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-26 07:00:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-26 07:49:14 +0300 |
commit | 77b66a96663c8e995160cc07287ccfea0e1a2b9b (patch) | |
tree | 5fb1d18486bb975e97e8814f79b2af0917eda1e9 /source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl | |
parent | 9b40da94a3e354265c692579f47a8f294e3b8196 (diff) |
DRW: support clipping for empty object
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl index 0d0413fef94..fed00389fc1 100644 --- a/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl @@ -1,5 +1,6 @@ uniform mat4 ViewProjectionMatrix; +uniform mat4 ModelMatrix; /* ---- Instantiated Attribs ---- */ in vec3 pos; @@ -17,6 +18,12 @@ flat out vec4 finalColor; void main() { - gl_Position = ViewProjectionMatrix * InstanceModelMatrix * vec4(pos * size, 1.0); finalColor = color; + + vec4 pos_4d = vec4(pos * size, 1.0); + gl_Position = ViewProjectionMatrix * InstanceModelMatrix * pos_4d; + +#ifdef USE_WORLD_CLIP_PLANES + world_clip_planes_calc_clip_distance((ModelMatrix * InstanceModelMatrix * pos_4d).xyz); +#endif } |