diff git a/src/modules/fiberStipples/shaders/WFiberStipplesfragment.glsl b/src/modules/fiberStipples/shaders/WFiberStipplesfragment.glsl
index 2e7ddc92591dac2f7bd4ae0c4a3665fc0abaee3a..52110bbf62b59532f48372326593507733e767ab 100644
 a/src/modules/fiberStipples/shaders/WFiberStipplesfragment.glsl
+++ b/src/modules/fiberStipples/shaders/WFiberStipplesfragment.glsl
@@ 24,43 +24,19 @@
#version 120
#include "WGEUtils.glsl"
+#include "WGEUtils.glsl" // for distancePointLineSegment(...)
+#include "WFiberStipplesvaryings.glsl"
/**
* Color of the fiber stipples. This will be further combined with tract probability.
*/
uniform vec4 u_color;
/**
 * First focal point, which is one of the endings of the projected diffusion direction.
 */
varying vec3 focalPoint1;

/**
 * Second focal point, which is one of the endings of the projected diffusion direction.
 */
varying vec3 focalPoint2;

/**
 * First focal point, scaled.
 */
varying vec3 scaledFocalPoint1;

/**
 * Second focal point, scaled.
 */
varying vec3 scaledFocalPoint2;

/**
* Middle point of the quad in texture coordinates, needed for scaling the projection of the principal diffusion direction to fit inside quad.
*/
uniform vec3 middlePoint_tex = vec3( 0.5, 0.5, 0.0 );
/**
 * Probability of the tract, used for further color mapping.
 */
varying float probability;

/**
* Scale the radius of the glyphs (aka stipples).
*/
diff git a/src/modules/fiberStipples/shaders/WFiberStipplesvaryings.glsl b/src/modules/fiberStipples/shaders/WFiberStipplesvaryings.glsl
new file mode 100644
index 0000000000000000000000000000000000000000..859399eacddd151e9a4666747924fc16ba543fac
 /dev/null
+++ b/src/modules/fiberStipples/shaders/WFiberStipplesvaryings.glsl
@@ 0,0 +1,50 @@
+//
+//
+// Project: OpenWalnut ( http://www.openwalnut.org )
+//
+// Copyright 2009 OpenWalnut Community, BSV@UniLeipzig and CNCF@MPICBS
+// For more information see http://www.openwalnut.org/copying
+//
+// This file is part of OpenWalnut.
+//
+// OpenWalnut is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// OpenWalnut is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with OpenWalnut. If not, see .
+//
+//
+
+#version 120
+
+/**
+ * First focal point, which is one of the endings of the projected diffusion direction.
+ */
+varying vec3 focalPoint1;
+
+/**
+ * Second focal point, which is one of the endings of the projected diffusion direction.
+ */
+varying vec3 focalPoint2;
+
+/**
+ * First focal point, scaled.
+ */
+varying vec3 scaledFocalPoint1;
+
+/**
+ * Second focal poin, scaled.
+ */
+varying vec3 scaledFocalPoint2;
+
+/**
+ * Scaled connectivity score; now between 0.0...1.0.
+ */
+varying float probability;
diff git a/src/modules/fiberStipples/shaders/WFiberStipplesvertex.glsl b/src/modules/fiberStipples/shaders/WFiberStipplesvertex.glsl
index e71622f94d256e4372122100b5920c46ce6db89a..ef008e9046c190df5c8c3fa4e3839fabc626966e 100644
 a/src/modules/fiberStipples/shaders/WFiberStipplesvertex.glsl
+++ b/src/modules/fiberStipples/shaders/WFiberStipplesvertex.glsl
@@ 25,6 +25,7 @@
#version 120
#include "WGETextureTools.glsl"
+#include "WFiberStipplesvaryings.glsl"
/**
* These two uniforms are needed to transform the vectors out of their texture
@@ 79,47 +80,27 @@ uniform float u_pixelSizeY;
*/
uniform float u_pixelSizeZ;
// vectors spanning the plane of the quad
uniform vec3 u_aVec;
uniform vec3 u_bVec;

/**
 * First focal point, which is one of the endings of the projected diffusion direction.
+ * First plane vector spanning the plane of the quad.
*/
varying vec3 focalPoint1;
+uniform vec3 u_aVec;
/**
 * Second focal point, which is one of the endings of the projected diffusion direction.
+ * Second plane vector spanning the plane of the quad.
*/
varying vec3 focalPoint2;
+uniform vec3 u_bVec;
// Scaled focal points, as otherwise the the stipple endings may not fit inside quad.
/**
 * Fixed factor for scaling.
+ * Used for scaling the focal points, as otherwise the the stipple endings may not fit inside quad.
*/
uniform float scale = 0.8;
/**
 * First focal point, scaled.
 */
varying vec3 scaledFocalPoint1;

/**
 * Second focal poin, scaled.
 */
varying vec3 scaledFocalPoint2;

/**
* Maximum connectivity score withing the probabilistic tract dataset. This is
* needed for scaling the connectivities between 0.0 and 1.0.
*/
uniform float u_maxConnectivityScore;
/**
 * Scaled connectivity score; now between 0.0...1.0.
 */
varying float probability;

/**
* Probabilities below this threshold are ignored and discarded.
*/