diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-24 23:13:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-24 23:13:02 +0300 |
commit | 6d8394d38b17e602535c75a866332f4427adbfad (patch) | |
tree | c583181880d07af3f07e6e0164239c730ff90885 /source/blender/gpu | |
parent | a4fe338dd8c6822d27b8858bae5fa9a54972719c (diff) |
DRW: support clipping for camera objects
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl index 805ecd6085f..07328385838 100644 --- a/source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl @@ -1,5 +1,8 @@ uniform mat4 ViewProjectionMatrix; +#ifdef USE_WORLD_CLIP_PLANES +uniform mat4 ModelMatrix; +#endif /* ---- Instantiated Attribs ---- */ in float pos; @@ -47,4 +50,8 @@ void main() gl_Position = ViewProjectionMatrix * InstanceModelMatrix * vec4(pPos, 1.0); finalColor = vec4(color, 1.0); + +#ifdef USE_WORLD_CLIP_PLANES + world_clip_planes_calc_clip_distance((ModelMatrix * InstanceModelMatrix * vec4(pPos, 1.0)).xyz); +#endif } |