Could you write a function so that for point (x,y) it returns true if the point is "in" the spierpinski triangle? Yes, I am wondering if it could be expressed as a fragment shader :)
You can exploit this nifty fact: in a pixel grid if you color a pixel at (x, y) based on whether (x & y) == y, you get a discrete, right-angled approximation of the Sierpinski triangle! Transform x and y appropriately to get the equilateral version.
https://play.rust-lang.org/?version=stable&mode=debug&editio...
Edit: quick Shadertoy version: https://www.shadertoy.com/view/flVXDh