3 ms·
It's interesting how this + also (linked in other comments) marching squares method do this all with math.. I have done this effect before in computer games wit
by everyone 4y ago
It's interesting how this + also (linked in other comments) marching squares method do this all with math.. I have done this effect before in computer games with shaders and its ridiculously simple with no math. You just have a wispy circle sprite that gradually fades from 100% alpha to 0% alpha for each particle. And in pixel shader you look at the combined alpha values to decide if a pixel is solid or not.
- roywiggins 4y agoIt's one of those curves that's much easier to define implicitly than to explicitly find the border. If you don't mind testing each pixel to see if it should be "in" or "out" then you can draw a picture of it easily. But if you want an explicit function for the boundary or avoid calculating much of the pixels, you'll need something like marching squares or more math to find it. The SVG solution here is nice in that increasing the resolution doesn't require you to do any more computation to determine where the border should be, and the border will always be exact and smooth; you even get antialiasing "for free".
- everyone 4y agoYeah totally, but if u have a pixel shader then u are running some code for every pixel anyway. I think this highlights how different code that's to run on CPU can be from code that's to run on GPU.