Page 1 of 1

Polar Coordinates plugin

Posted: Fri Feb 12, 2016 10:32
by BDivider
Hi everybody!
trying to work with some circular shapes just wondering does somebody knows any kind of polar coordinates plugin or method to achieve that in resolume? thanks for your time!

kind regards,
B.

Re: Polar Coordinates plugin

Posted: Fri Feb 12, 2016 11:43
by Joris
It just so happens we have a polar coordinates plugin lined up for the 5.0.2 release.

Drop us a mail@resolume.com if you want early access.

Re: Polar Coordinates plugin

Posted: Sun Feb 14, 2016 01:22
by BDivider
Joris wrote:It just so happens we have a polar coordinates plugin lined up for the 5.0.2 release.

Drop us a mail at resolume.com if you want early access.
Thanks for your quick reply Joris!
can't wait to check it our or make some beta-testing if possible ;)

Re: Polar Coordinates plugin

Posted: Thu Oct 13, 2016 19:32
by gpvillamil
What came of this? Was it released as the PolarKaleido effect?

It would be great if there was a version that treated the "overflow" as black, so you get a circular image.

Re: Polar Coordinates plugin

Posted: Fri Oct 14, 2016 08:26
by Joris
This indeed is the PolarKaleido effect. We're sticking with the fullscreen version for now, but if you feel like rolling your own, here's the relevant shader:

Code: Select all

	uniform sampler2D texture;
	uniform vec2 resolution;
	uniform float rings;
	uniform float kaleidos;
	uniform float aspect;
	uniform float angle;
	

	void main()
	{
		vec2 coords = gl_FragCoord.xy / resolution - vec2(0.5);
		//adjust for aspect ratio
		coords.y /= aspect;
		
		//cartesion to polar with rings and kaleido vars
		float r =  length (coords) * (rings + 1.0);
		float theta = atan( coords.y, coords.x ) * kaleidos;
		
		//adjust center point of angle
		//get fracts so we get useable values
		float pi = 3.141592654;
		theta = ( theta + ( angle + 0.25 ) * 2.0 * pi * kaleidos ) / ( 2.0 * pi );
		vec2 endCoords = fract ( vec2( theta, r ));

		gl_FragColor = gl_Color * texture2D( texture, endCoords );
	}

Re: Polar Coordinates plugin

Posted: Fri Oct 14, 2016 08:39
by Joris
Hmmm. When reading the code back like this, I suppose it's kind of silly to pass in both the resolution and the aspect ratio as separate uniforms.