I’ve never written a demoscene program before, but while trying this tool out I think I figured out some basic techniques. I’d say this tool is great for learning due to its approachability.
Here’s what I made:
sin(i**2 * t/(2**12))
sin(i * t/64)
sin(x + t) + cos(y + 2*t)
y<3 |t>1&x+y>12&x+y<18 |t>2&y>12
(t - x - 1.1*y) % t
sqrt(t-y-1 - sin(x-t/4)) - 2
2 - sqrt(1.5*t-y-1 - tan(x+.5))
-cos(t)*8 - 7 + (x&y)
Tip: check out the documentation of the Math object and the bitwise operators for inspiration.
After further experimentation, I made some more:
1-hypot(x-8, y-8)/6 + sin(t*3)/6
x/6 + sin(y) - hypot(x-7,y-7)/4
1 - hypot(x-6,y-9)*6/t % 4
-cos(atan2(x+1,16-y) * (t*2-10))
There are some really great examples in this twitter thread: https://twitter.com/v21/status/1323403680922718208
For those with low tolerances:
For developers who have trouble wrapping their head around working with fragment shaders, this is the most succinct and complete explanation I have seen so far. EDIT: specifically making shapes with fragment shaders.
I see; I hadn’t known that fragment shaders (also called pixel shaders) were so similar. I found this page about drawing shapes with shaders: The Book of Shaders: Shapes. A lot of those techniques could be used in tixy.land.
I like https://tixy.land/?code=sin%28%28i%2Bt%29**%281%2Bt*1e-3%29%29 because it changes its appearance a few times before eventually collapsing into flashing mush.
https://tixy.land/?code=%28t%26x%261%29-%28t%26y%261%29 does an alternating blinky pattern
https://tixy.land/?code=%28%28t*4%25i%29*2-1 is so simple it feels like cheating but it is a visual prime tester. :)
Also I suggested the “art” tag. ❤️
Visual prime tester URL has unbalanced brackets. Needs an ending %28 or to lose the %28 at the start :)
Thanks! I think somehow I managed to accidentally paste a WIP version of that one. The effect I was going for was more like https://tixy.land/?code=%28%28t*2%29%25i%29*2-1
sin(t) * (ceil((x * y) / 2) / t) gives a really cool “galaxy quadrant dying out” effect. This is fun.
sin(t) * (ceil((x * y) / 2) / t)
Link for convenience: sin(t) * (ceil((x * y) / 2) / t)
I’m not great at this stuff. this is the best I could come up with
This is honestly fantastic. (sin(t/i)+tan(i/t))/(x*y)