- Color pool(gradient(dist,supersample*0.5).premult_alpha()*(1.0-(dist-supersample*0.5)));
- pool+=gradient((dist+supersample*0.5)-1.0,supersample*0.5).premult_alpha()*((dist+supersample*0.5)-1.0);
+ float left(supersample*0.5-(dist-1.0));
+ float right(supersample*0.5+(dist-1.0));
+ Color pool(gradient(1.0-(left*0.5),left).premult_alpha()*left/supersample);
+ if (zigzag) pool+=gradient(1.0-right*0.5,right).premult_alpha()*right/supersample;
+ else pool+=gradient(right*0.5,right).premult_alpha()*right/supersample;