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.
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’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)
(y+t)%2-(x+t)%2
(x-y>-7&y-x>-7)*tan(x-y)
sin(x + t) + cos(y + 2*t)
tan(hypot(x-6,y-6))-tan(t/2)/20
sin(hypot(x-6,y-6))-tan(t)/20
cos(hypot(x*t/2-16,y*t/2))-1+y/8
y<3 |t>1&x+y>12&x+y<18 |t>2&y>12
(y+t/4)%2+(x+t/4)%2-2
(t - x - 1.1*y) % t
sqrt(t-y-1 - sin(x-t/4)) - 2
cbrt(y)-cbrt(sin(x))-2
cbrt(y)-cbrt(cos(x))-1-3*sin(t)
2 - sqrt(1.5*t-y-1 - tan(x+.5))
&
patterns:random()/8-1/16+cos(t/2|x&y)
&
pattern:-cos(t)*8 - 7 + (x&y)
tan(i)/2+cos(t*2)*3
-tan(i)/5+sin(t)*32-25
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
abs(1+hypot(x-6,y-9)/2-t%3*4)
1 - hypot(x-6,y-9)*6/t % 4
hypot(x-7,y-9)*3/(-sin(t)+2)%2-1
hypot(x-7,y)*9/(cos(t/3)+3)%3-1
cos(atan2(x-7,y-9)*(cos(t)+1)*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:
https://nitter.net/v21/status/1323403680922718208
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. ❤️
Nice examples!
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.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 https://tixy.land/?code=1%2Fcos%28t%29*sin%28t%29%2Fx%2Fy
This is honestly fantastic.
(sin(t/i)+tan(i/t))/(x*y)