diff options
Diffstat (limited to 'source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl')
-rw-r--r-- | source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl b/source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl index d4d7c455b1b..13431168fb0 100644 --- a/source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl +++ b/source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl @@ -9,12 +9,6 @@ uniform mat4 ModelViewProjectionMatrix; uniform mat4 ModelMatrix; uniform ivec4 dataMask = ivec4(0xFF); -#ifdef USE_WORLD_CLIP_PLANES -uniform vec4 WorldClipPlanes[6]; -uniform int WorldClipPlanesLen; -#endif - - in vec3 pos; #ifdef VERTEX_FACING in vec3 vnor; @@ -43,12 +37,7 @@ void main() # endif # ifdef USE_WORLD_CLIP_PLANES - { - vec3 worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz; - for (int i = 0; i < WorldClipPlanesLen; i++) { - gl_ClipDistance[i] = dot(WorldClipPlanes[i].xyz, worldPosition) + WorldClipPlanes[i].w; - } - } + world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz); # endif } @@ -115,12 +104,7 @@ void main() # endif # ifdef USE_WORLD_CLIP_PLANES - { - vec3 worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz; - for (int i = 0; i < WorldClipPlanesLen; i++) { - gl_ClipDistance[i] = dot(WorldClipPlanes[i].xyz, worldPosition) + WorldClipPlanes[i].w; - } - } + world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz); # endif } |