Copy link to clipboard
Copied
Hello, total noob here trying to port the Polar Inversion distortion effect (specifically the clamp mode) from Paint.net to AE.
Here are some images of the effect, [strength] [mode], 0 - 0.5 clamp, -2 clamp, 3 reflect



I've done some searching and asked in other places about recreating the effect but it doesn't seem to be possible.
As a result of my searching I've found this code snippet https://forums.getpaint.net/topic/112637-how-polar-inversion-works/
protected override void InverseTransform(ref WarpEffectBase.TransformData data)
{
double x = data.X;
double y = data.Y;
double invertDistance = DoubleUtil.Lerp(1.0, base.DefaultRadius2 / (x * x + y * y), this.amount);
data.X = x * invertDistance;
data.Y = y * invertDistance;
}
So would this code somehow work as a plugin or is there simply an easier way to do the effect?
Thanks in advance
So, I compiled my version of the algorithm (I also added some extra parameters) into a native AE plugin for Windows and MacOS that you can download here:
http://reduxfx.com/rfx_polarinversion.zip
WARNING: This comes free of charge, but completely without warranty, guarantee, support or whatever. Basically just a little developer experiment.
Cheers,
Tobias Fleischer
Copy link to clipboard
Copied
there are two aspects to this question.
1. algorithmical. i don't know if the algorithm you posted does what you
expect it to do or not, however there's no reason why it shouldn't
translate successfully to the AE API.
2. infrastructure. building a plug-in entails doing A LOT of general
infrastructure work, such as setting up your work environment (win/mac
separately), compiling debug and release versions, defining effect
parameters, hooking up param values to your algorithm, ect...
so i think the one question here, is what do you want to end up having? if
the answer is "sale-worthy AE effect", then there are no other options but
to dive into the SDK. if the answer is "i don't know yet. fiddling around
and i'll think about it later" then perhaps there are easier way about this.
for example, there was a parallel AE API called "pixel bender". it got
dropped and is no longer supported, however if you have older version of AE
installed, you could experiment with it. it's WAY easier to set up and
effect from scratch with pixel bender, and plugging in some pixel handling
algorithm is as super quick.
Copy link to clipboard
Copied
Polar inversion of coordinates is a dead simple effect/algorithm, and I am not sure if AE itself does not already come with a plugin for that.
The snippet you posted is the basic coordinate transformation, it does what you expect and is a one-liner to put into the processing section of a plugin.
Here I created a little GLSL shader with the code snippet from you so you can see it in action:
But as Shachar already said, the whole AE plugin infrastructure around it is much more complex, in order to get a working plugin for such a simple effect.
Furthermore, I don't know how paint.net has this effect implemented, as from your description there seems to be more parameters (reflect, clamp, etc.) that are not covered in that simple transform you posted.
Cheers,
Toby
Copy link to clipboard
Copied
AE comes with CC Flomotion that does it similar to reflect mode and unlike paint.net it has two knots instead of one
Your shader does it in tile mode and if it could do it in clamp it would be just what I need.
I'll try looking into Pixel Bender or just using something else
Copy link to clipboard
Copied
Not sure how paint.net does clamping, but if it is only for the uv coordinates, you can add a line like uv = clamp(uv, 0., 1.); before the the last line. If you want I can compile the shader above as a native AE plugin for you.
Copy link to clipboard
Copied
Sorry for the late reply, but I just checked and it's perfect if you just add uv = clamp(uv, 0., 1.);
If you could compile it as a plugin I'd appreciate it
Copy link to clipboard
Copied
Will do that next Week, I am currently busy at Sitges Film Festival ![]()
Copy link to clipboard
Copied
So, I compiled my version of the algorithm (I also added some extra parameters) into a native AE plugin for Windows and MacOS that you can download here:
http://reduxfx.com/rfx_polarinversion.zip
WARNING: This comes free of charge, but completely without warranty, guarantee, support or whatever. Basically just a little developer experiment.
Cheers,
Tobias Fleischer
Copy link to clipboard
Copied
Thank you, this is far more than what I asked for
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more