Polar Coordinates plugin

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
BDivider
Met Resolume in a bar the other day
Posts: 2
Joined: Fri Feb 12, 2016 10:29

Polar Coordinates plugin

Post 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.

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

Re: Polar Coordinates plugin

Post 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.

BDivider
Met Resolume in a bar the other day
Posts: 2
Joined: Fri Feb 12, 2016 10:29

Re: Polar Coordinates plugin

Post 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 ;)

User avatar
gpvillamil
Wants to marry Resolume, and Resolume said "yes!"
Posts: 550
Joined: Mon Apr 04, 2005 03:33
Location: San Francisco, California

Re: Polar Coordinates plugin

Post 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.

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

Re: Polar Coordinates plugin

Post 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 );
	}

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

Re: Polar Coordinates plugin

Post 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.

Post Reply