pouët.net

Go to bottom

How to create the source map/image for a color cycler from Promised Lands

category: code [glöplog]
 
hey guys,

i am boggling my brain around how to create the source map/image for a color cycler like one from "Promised Lands":

https://youtu.be/c_6a6K2HtXU?t=16m40s

i have tried some variants with cathesian-polar stuff, but still it's far from getting there.

and tbh my maths skills are.. well.. limited.. when it comes to such visualisation stuff.

is this maybe some kind of metaball attraction stuff between the two nodes?
or maybe something like magnetic forces?

i am thankful for any helpful idea on how to get there..

yeah yeah, the c64 has not seen too many colorcyclers already, but this one is just too nice to not try to make it myself.
added on the 2018-08-24 15:33:12 by dAno dAno
Even more compact version: https://www.shadertoy.com/view/4lVXWw
added on the 2018-08-24 16:36:12 by Gargaj Gargaj
The shaders that Gargaj posted show the inside of a torus. The pattern in Promised Lands is from a Möbius Transformation using the 2D screen coordinates as complex numbers.

There is some relevant information here: https://en.wikipedia.org/wiki/M%C3%B6bius_transformation#Iterating_a_transformation

And here's a shader: https://www.shadertoy.com/view/XdyXD3
added on the 2018-08-24 16:45:35 by fizzer fizzer
+ by the looks of it there's 2 or 3 buffers involved to make the colorcycling smoother
added on the 2018-08-24 17:16:49 by havoc havoc
I had this exact question in my mind when watching the demo!
Thanks fizzer for the code, now to figure out how all that Shader-vector style code works!
added on the 2018-08-24 17:56:31 by Sdw Sdw
@havoc: yes there are surely something like 4 bitmaps going on with the speedcode to fill the screenram from a table of 32 colors. atleast that's what i am doing here with other parts that operate like that (i.e. tunnel).

@fizzer: thanks a ton! will peek into there with some more time.

thanks guys for the hints already, big up!
added on the 2018-08-24 18:26:37 by dAno dAno
tried toying around with the shader on the road. with the code below there's this weird offsetting line between the two points. any spontaneous idea on how to avoid this?

Code:// variant of https://www.shadertoy.com/view/4sGXDK // compact version of https://www.shadertoy.com/view/4dcSWs void mainImage(out vec4 O, vec2 U){ vec2 z = iResolution.xy; // normalized coordinates U = (U+U - z) / z.y; z = U - vec2(-1,0); U.x -= 0.5; // Moebius transform U *= mat2(z,-z.y,z.x) / dot(U,U); //U+=.5; // offset. not included as length(U+=.5) because of an ATI bug // spiral, zoom phase // spiraling U = log(length(U+=0.05))*vec2(-0.5, +0.5) + iTime/8. + atan(U.y, U.x)/18.3 * vec2(12.5, 1); // n //O += length(fract(U*3.)) -O; //O = texture(iChannel0, fract(U*3.)); // U*1. is also nice //O += length(sin(U*30.)) -O; O = 0.5+.5*sin(2.*3.14159*U.x+vec4(0,2.1,-2.1,0)); // try also U.x //O /= max(O.x,max(O.y,O.z)); // saturates the rainbow }
added on the 2018-08-24 19:20:11 by dAno dAno
Okay I apologise, that code is quite unreadable actually. I've put my own example on to Shadertoy here: https://www.shadertoy.com/view/MtKcR1

It uses actual complex number functions so you can hopefully better see what's going on.
added on the 2018-08-24 22:06:29 by fizzer fizzer
@fizzer: thanks mate, will give it a proper look with a fresh mind tomorrow!
added on the 2018-08-25 00:54:59 by dAno dAno

login

Go to top