diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-21 09:48:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-21 09:50:31 +0300 |
commit | a06b2b25adb2b0a1232ae78ba82e0ecef8cdf976 (patch) | |
tree | 38438ecdb7dc3d339ad665395144c9356b9c4bae /source/blender/draw/modes/shaders/edit_normals_geom.glsl | |
parent | 1ab071bd5cc662be5088bc48c1bb605a727c3656 (diff) |
DRW: pass clipping to geom shader via 'gl_in'
Removes need to pass the worldspace location.
Diffstat (limited to 'source/blender/draw/modes/shaders/edit_normals_geom.glsl')
-rw-r--r-- | source/blender/draw/modes/shaders/edit_normals_geom.glsl | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/source/blender/draw/modes/shaders/edit_normals_geom.glsl b/source/blender/draw/modes/shaders/edit_normals_geom.glsl index 323761abd1b..50214c75e6a 100644 --- a/source/blender/draw/modes/shaders/edit_normals_geom.glsl +++ b/source/blender/draw/modes/shaders/edit_normals_geom.glsl @@ -3,33 +3,19 @@ layout(points) in; layout(line_strip, max_vertices=2) out; #ifdef USE_WORLD_CLIP_PLANES -uniform vec4 WorldClipPlanes[6]; uniform int WorldClipPlanesLen; #endif flat in vec4 v1[1]; flat in vec4 v2[1]; -#ifdef USE_WORLD_CLIP_PLANES -flat in vec3 wsPos[1]; -#endif void main() { -#ifdef USE_WORLD_CLIP_PLANES - float clip_distance[6]; - { - vec3 worldPosition = wsPos[0]; - for (int i = 0; i < WorldClipPlanesLen; i++) { - clip_distance[i] = dot(WorldClipPlanes[i].xyz, worldPosition) + WorldClipPlanes[i].w; - } - } -#endif - for (int v = 0; v < 2; v++) { gl_Position = (v == 0) ? v1[0] : v2[0]; #ifdef USE_WORLD_CLIP_PLANES for (int i = 0; i < WorldClipPlanesLen; i++) { - gl_ClipDistance[i] = clip_distance[i]; + gl_ClipDistance[i] = gl_in[0].gl_ClipDistance[i]; } #endif EmitVertex(); |