The trick is basically taking the C-like syntax of shader code and turning it into *actual* C code. The trouble is that C doesn't have vector operations build into the language (like you can do with C++ and operator overloading). I used to write my own vector operations for this, but discovered someone else did a much better job:
Even with multithreading, performance of the CPU shader code is quite terrible, as you'd expect. Which is why I don't even try to run them in realtime. BUT if you are okay with that, you get some very portable code that doesn't require working GPU drivers.
@jonbro A coworker of mine showed me this particular shader. This apparently was his seed of inspiration that plunged him into the world of shaders.
@paul I like that it doesn't even have a projection matrix - just falloff from 12 points. its incredible.
@jonbro I'm particularly fond of the slight asymmetry that emerges from it. Usually you don't get kind of nuance in code snippets this short.
@carl I was going to reply to this jokingly and say "bad math". But as it turns out, yes, it is bad math. The center black pixel is caused because something somewhere is producing a NaN.
A fediverse community for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that.