 
 uniform float scale;
 
-float cpEps = 0.5 / float(cpCount);
-float knEps = 0.5 / float(knotCount);
+float cpEps = 0.5 / float(cpCount + 1);
+float knEps = 0.5 / float(knotCount + 1);
 
 attribute vec4 position;
 attribute float l;

	vec4 knotsValue = texture2D(knotsTexture, vec2(u, 0.0));
	vec4 cpsValue   = texture2D(cpsTexture  , vec2(u, 0.0));
	
	result.y = ds[n].x;
	result.xy /= scale;
	//result.x = ds[n].y;
	//result.x = l;

// USER_PARAMETERS

vec4 function(float s) {
	return vec4(USER_FUNCTION, (1.0 - (0.5 * s / 0.5)) * ((1.0 - (0.5 * s / 0.5)) * 1.0 + (0.5 * s / 0.5) * 2.0) + (0.5 * s / 0.5) * ((1.0 - 0.5 * s) * 2.0 + 0.5 * s * 0.0), 0.0, 1.0);
}

void main() {
