Code from codepen.io/monfera/pen/GjOBkJ
Update: now it uses the WebGL extension OES_standard_derivatives
for antialiasing, if avaliable. There's also Z ordering and alpha blending, to support antialiasing with the alpha smoothstepping method. There's a slight trick, fwidth
is applied on dist
rather than r
so as to avoid artifacts where the formula yields near-zero radii.
It shows:
vec4
position attribute) to the GPU, and calculating the tweening on the GPU (contrast this to refreshing geometry in a rAF loopnumpy
-like interface, pretending that native typed JS arrays are multidimensional arrays (syntactic sugar in this case)It's not meant to be efficient as it's more of a test for various features. It can be made much faster/nicer in various ways.
Links:
regl
and much of scijs
scijs/ndarray
contributorregl
Uploaded with blockbuilder.org
https://rawcdn.githack.com/monfera/ndarray-bundle/cbbafcb5/ndarray.min.js
https://rawcdn.githack.com/regl-project/regl/v1.3.13/dist/regl.min.js