Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Polar Inversion effect

New Here ,
Oct 07, 2018 Oct 07, 2018

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

exmple.gifclamp high.pngreflect.png

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

TOPICS
SDK
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Oct 13, 2018 Oct 13, 2018

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

Translate
Community Expert ,
Oct 07, 2018 Oct 07, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 07, 2018 Oct 07, 2018

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:

Shadertoy BETA


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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 08, 2018 Oct 08, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 08, 2018 Oct 08, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 10, 2018 Oct 10, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 10, 2018 Oct 10, 2018

Will do that next Week, I am currently busy at Sitges Film Festival

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 13, 2018 Oct 13, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 14, 2018 Oct 14, 2018
LATEST

Thank you, this is far more than what I asked for

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines