@diatribes

50 Followers
88 Following
117 Posts

For #TilingTuesday, 4-colourings of the Penrose P2 and P3 tilings, via refinements of their substitution systems.

Penrose tilings must _admit_ proper 4-colourings, by the Four Colour Theorem and the Erdős–de Bruijn theorem. 4CT says that any finite patch of a given plane tiling must have a 4-colouring; EdB says, in that case, so does the whole plane.

But EdB doesn't provide an efficient algorithm for constructing such a colouring; it only guarantees that one exists in principle. If you wanted a large patch of 4-coloured tiling, you might have to generate a finite patch first, and then run one of the horrible algorithms from proofs of 4CT. And once you'd done it, there'd be no guarantee that _that_ 4-coloured patch would extend to a 4-colouring of the whole plane.

What you want is a refined substitution system, containing multiple types of each Penrose tile shape, each already equipped with a colour. Then you could generate tilings efficiently from that, and you'd know you had not just a finite coloured patch, but a finite patch from a whole coloured plane.

For P3 (rhombs) this is easy. Split each rhomb into a subtype for each of its 10 rotations. The adjacency graph on those 20 classes has no self-edges. There's no reason to expect that graph to be _planar_, but it turns out it can be 4-coloured anyway. So you can 4-colour a P3 tiling by assigning colours based only on tile shape and orientation.

For P2 (kites and darts), if you make the same graph, it doesn't admit a 4-colouring. But as part of my transducers research, I wrote code to refine a substitution system further, by classifying each tile based on its immediate neighbours. If I classify the P2 tiles by orientation and _then_ run a pass of that refinement algorithm, it generates 50 subtypes of kite and 40 subtypes of dart, and the adjacency graph for _those_ classes is 4-colourable. So it takes a bit more work, but it's still a substitution system that directly delivers a 4-coloured P2 tiling.

The pictures here are derived from those two refined substitution systems. In each case, the 4-colouring of the class graph was done by brute force: SageMath's first_coloring() function. So the colours aren't optimised for aesthetics!

Updated the title screen for the upcoming playtest. Just a few finishing touches left and we're ready to go!

#gamedev #indiegame

#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

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