diff options
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl | 8 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_3D_vert.glsl | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl index a1feb2f75b7..955ce07780c 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl @@ -1,6 +1,10 @@ uniform mat4 ModelViewProjectionMatrix; +#ifdef USE_WORLD_CLIP_PLANES +uniform mat4 ModelMatrix; +#endif + in vec3 pos; in vec4 color; @@ -10,4 +14,8 @@ void main() { gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); finalColor = color; + +#ifdef USE_WORLD_CLIP_PLANES + world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz); +#endif } diff --git a/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl index 059473ebb74..9fc748b292b 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl @@ -1,9 +1,17 @@ uniform mat4 ModelViewProjectionMatrix; +#ifdef USE_WORLD_CLIP_PLANES +uniform mat4 ModelMatrix; +#endif + in vec3 pos; void main() { gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); + +#ifdef USE_WORLD_CLIP_PLANES + world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz); +#endif } |