I made a graph called Heartbleed a while ago and wanted to write a little bit about it. The graph is a domain-colored "pastel" piece that's made up of a bunch of hearts, inspired by other heart themed domain colorings on Reddit.
It looks complicated, but it's actually quite intuitive to construct. You will first of all need to use beta3d. You can go to the Desmos subreddit and message "!beta3d" to this post to get more info. If you don't want to use beta3d, that's fine. Just use the function we are going to define below and use it in a pixel grid instead of in a beta3d shader (though it will look a bit low quality without beta3d shaders)
First, define a region . In this graph, I found a graph of tiled hearts on Reddit:
Then, pick two pretty domain colored graphs, maybe something you found somewhere else on the internet. Let's call these and . So lets create the following domain colored graph:
Color it with the following shader:
The result is the following:
Of course, you can tinker with and . But I think you would agree that it looks a little... jagged. This is because we are immediately switching between one domain colored graph to another when inside the heart shaped region. I think it would look a lot better if you could somehow "smooth" the edges.
This is something a smoothstep can do! Note that, instead of switching from to , we can use a lerp , where . Then, we can simply substitute for an exponential smoothstep, something like so:
This is so much nicer! In fact, you can play around with the smoothing factor by change e to an animation variable a, which looks even more mesmerizing:
Here is the final graph: https://www.desmos.com/3d/6mkriy8q89