A first attempt to rasterize arbitrary 2-D functions using the signs of four sample points (one for earch corner of a pixel). It works, but it can be optimized further by using a quadtree and recursively sample the sign values using that, instead of iterating over every pixel.
Here we go. The thickness of the graph can now extended to it's neighbor pixels, thanks to morphology. One last thing is smoothing.
#Shadertoy #GLSL #WebGL #Rasterization #Algorithm #Math #Functions #Programming




Hacker News