Fork me on GitHub
#off-topic
<
2024-02-13
>
pez07:02:21

Shaders. Just when I thought they could not get more magical, I find this tool for making shaders that fit in a tweet. Someone (perhaps the tool author) found a way to use a shader to tweet something like: > In the beginning God created the heaven and the earth. …

for(float e,i,a,w,x,g,h;i++<90.;o+=.01-.02/exp(max(s,e)*3e3)/h){vec3 p=vec3((FC.xy-.5*r)/r.y*g+2.,g);p.zy*=rotate2D(.5);e=p.y;h=e+p.x*.3;p.z+=t;for(a=.6;a>.001;a*=.7)p.xz*=rotate2D(5.),x=(p.x+p.z)/a+t+t,e-=w=exp(sin(x)-3.)*a,h+=abs(dot(sin(p.xz/a*.3)*a,r/r));g+=e=min(e,h*.5-1.);}
https://twigl.app/?ol=true&amp;ss=-NqUk6pcpkcFek1iupHp 🤯 The tool even has features for creating GIFs.

wow 9
haris13:02:24

Very cool. Replace exp(sin(x)-3.) with exp(asin(x)-3.) and you get mountains.

haris17:02:51

While too advance for me, the best video I found explaining this stuff is this: https://www.youtube.com/watch?v=BFld4EBO2RE

🙏 1
pez18:02:51

In the general area of rendering with math, I find this one fantastic: https://www.youtube.com/watch?v=8--5LwHRhjk

chucklehead18:02:26

Since the article doesn’t seem to mention the actual bound, looks like they proved that for arbitrary k, O(k) insert/deletes and O(1) lookups with O(log^(k) n) bits of overhead per key is optimal. https://arxiv.org/abs/2111.00602

andy.fingerhut18:02:58

The article does have a mention from one of the paper authors that the constant factors hidden inside the big O() notation are fairly large, which means their technique might not be practical for realistic size hash tables that people want to use. I haven't tried to figure out what those constant factors are from the research paper. Probably trying to implement the algorithm would be a good way to find out, but I'm discouraged from spending too much time on such a project given that statement from the author.

andy.fingerhut18:02:08

Still, cool stuff.

chucklehead18:02:49

This is additional work by some of the same authors on a hashtable for Optane/persistent memory architectures, that might be interesting to see how applicable the techniques are to persistent data structures in a GC language. https://arxiv.org/pdf/2210.04068.pdf