@diatribes

50 Followers
86 Following
113 Posts
#define V vec3
#define L length(p-V(
void main(){V q,p,a,b,c,o;for(float i,t,l,s,d=1.;i++<3e1&&d>.001;o+=V(3,2,1)*exp(-l*9.)/s+.2/l){p=normalize(V(P+P-R,R.y))*t-V(2,-4,2);p.yz*=mat2(cos(vec4(0,33,11,0)-.4));a=round(q=p+V(-1,s=3.,0)*T*.4);for(int j;j<8;j++)b=a+V(j/4,j/2&1,j&1)*sign(q-a),c=b*V(.82,.67,.55),s=max(min(s,length(q-b+fract(c.zxy*c.yzx+c)*.97-.485)-.015),.01);t+=d=min(min(L 0,min(p.y,6.),0)),L clamp(p.x,-.8,0.),5.8,0)))-.1,min(s,l=.2*max(L-.8,5.5,0))-.1,.01)));}O=vec4(tanh(o*.01),1);}
Raining Stars

RE: https://fosstodon.org/@bug/115777356888947511

This #demo took me a little while.

The domain repetition was not that straightforward, but nothing insurmountable. On the other hand, finding a tiny hashing/mixing function (for the snowflakes offset) was. There are some using trigo (not reliable/portable) or simply too large.

I ended up multiplying by V(.82,.67,.55) which is a rough approx of 1/(𝜑₃,𝜑₃²,𝜑₃³) from https://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/

And then I "mixed" and mod 1 with fract(c.zxy*c.yzx+c).

Not perfect but enough for the illusion here ️❄️

Long overdue, but I finally made a dedicated index page for my tiny #glsl demos: https://art.pkh.me

It's a bit bland at the moment, and there aren't a lot of #shaders, but I'm of course going to add more and more as time goes.

#art #demoscene

@tessela_is thank you! :D

void mainImage(out vec4 o, vec2 u) {

vec3 c,p,r = iResolution;

float i, s, d;

for(; i++ < 1e2;
d += s = .01+ abs(1. - length(p.xy))*.3,
c += (1.3+cos(3.*p.z+vec3(6,4,2))) / s / d
)
for(p = vec3((u+u-r.xy)/r.y * d, d + iTime),
p.x *= .15,
p.z = .4*cos(p.z*.6),
s = 4.; s++ < 8.;
)
p.xz += asin(sin(p.zx*s))/s;;
o.rgb = tanh(c / 1e3);
}

https://www.shadertoy.com/view/tctfDs

#glsl #shader