TechnoRobbo Posted May 6, 2014 Share Posted May 6, 2014 (edited) TechnoRobbo's Glass Vignette v1.1 A Refraction-like distortion with an un-distorted center. v1.1 - Alpha-friendly Menu: Effect -> Distort Source Code Hidden Content: // Submenu: Distort // Name: TR's Glass Vignette // Title: TR's Glass Vignette // Author: TechnoRobbo // URL: http://www.technorobbo.com #region UICode double Amount1 = 0.761; // [0.001,1] Refraction Pair<double, double> Amount2 = Pair.Create( 0.0 , 0.0 ); // Control Description double Amount3 = 1.01; // [1.01,1.2] Chromatic Aberration double Amount4 = 1; // [1,100] Zoom #endregion void Render(Surface dst, Surface src, Rectangle rect) { // Delete any of these lines you don't need Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((selection.Right - selection.Left) / 2)+selection.Left; int CenterY = ((selection.Bottom - selection.Top) / 2)+selection.Top; double aberate = (Amount1 - .001)/.999; aberate = 1 * aberate + Amount3 * (1-aberate); aberate *= aberate; Surface tmp = src.Clone(); tmp.Clear(ColorBgra.Transparent); tmp.CopySurface(src,new System.Drawing.Point((int)(-Amount2.First * CenterX), (int)(-Amount2.Second * CenterY))); double CenterMax =Math.Sqrt(CenterX * CenterX + CenterY * CenterY); double zoom =(101 - Amount4)/100; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { double maxx =(x-CenterX); double maxy =(y-CenterY); double far = Math.Sqrt(maxx * maxx + maxy * maxy ); double rad = Math.Atan2(maxy ,maxx + .0001 ); double effect = far/CenterMax; double refractR = Math.Pow(far,Amount1) * aberate ; double refractB = Math.Pow(far,Amount1); double offxS = Math.Cos(rad) * far * zoom + CenterX; double offxR = Math.Cos(rad) * refractR * zoom + CenterX; double offxB = Math.Cos(rad) * refractB * zoom + CenterX; double offyS = Math.Sin(rad) * far * zoom + CenterY; double offyR = Math.Sin(rad) * refractR * zoom + CenterY; double offyB = Math.Sin(rad) * refractB * zoom + CenterY; offxR = offxS * (1- effect) + offxR * effect; offyR = offyS * (1- effect) + offyR * effect; offxB = offxS * (1- effect) + offxB * effect; offyB = offyS * (1- effect) + offyB * effect; ColorBgra CPR = tmp.GetBilinearSample((float)offxR,(float)offyR); ColorBgra CPB = tmp.GetBilinearSample((float)offxB,(float)offyB); ColorBgra CP = ColorBgra.FromBgra(CPB.B,(byte)((CPR.G + CPB.G)/2),CPR.R,(byte)((CPR.A + CPB.A)/2)); dst[x,y] = CP; } } tmp.Dispose(); } TRsGlassVignette.zip Edited September 20, 2015 by TechnoRobbo 8 Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted May 6, 2014 Share Posted May 6, 2014 Gosh. That's a nice effect for such a (relatively) simple source. I think I actually understand some of it Many thanks for both the effect and the source TechnoRobbo! 1 Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Cc4FuzzyHuggles Posted May 6, 2014 Share Posted May 6, 2014 That's cool looking! Thank You for your work! Quote *~ Cc4FuzzyHuggles Gallery ~* Link to comment Share on other sites More sharing options...
DrewDale Posted May 6, 2014 Share Posted May 6, 2014 Cool plugin Went from this: To This: Almost Darth Vader style 3 Quote Link to comment Share on other sites More sharing options...
Seerose Posted May 6, 2014 Share Posted May 6, 2014 That is such a cool plugin. Thank yo so much TechnoRobbo. Germany/Berlin 2 Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
TechnoRobbo Posted May 6, 2014 Author Share Posted May 6, 2014 (edited) EER - Thanks -the code is actually some unused routines from developing PasteWarp. It takes a warped mind to make a warped plugin. CC4FH,DD and Seerose - Thank you, your kind. Nice examples too. DD -It does look liike Darth Vader. I should have published it on May the 4th not May the 5th. May the 4th be with you. (OK, OK, I sense a disturbance in the force, like millions of voices groaning over a bad joke). Edited May 6, 2014 by TechnoRobbo 2 Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
david.atwell Posted May 6, 2014 Share Posted May 6, 2014 Oooh. Now you can move the bean anywhere in the world you want to! Like. Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
mottoman Posted May 6, 2014 Share Posted May 6, 2014 Love it. Thanks TR. Great images posted Original 2 Quote Link to comment Share on other sites More sharing options...
doughty Posted May 6, 2014 Share Posted May 6, 2014 Mottoman, I think you captured TR's avatar image beautifully. 1 Quote Link to comment Share on other sites More sharing options...
mottoman Posted May 6, 2014 Share Posted May 6, 2014 Mottoman, I think you captured TR's avatar image beautifully. Now that I look again, you are right. Well spotted doughty. Quote Link to comment Share on other sites More sharing options...
Pixey Posted May 6, 2014 Share Posted May 6, 2014 Ooooh - yet another really cool Plugin @TR - Many thanks. So many possibilities - could play all day. And .......... I get to sit on the Loch Ness Monster and be wiped out by a Tsunami at the same time 2 Quote How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon. Link to comment Share on other sites More sharing options...
Red ochre Posted May 6, 2014 Share Posted May 6, 2014 Fun plugin TR - thanks!Very creative examples from everyone too. 1 Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Lloyd Posted May 6, 2014 Share Posted May 6, 2014 Fun plugin TR - thanks! Very creative examples from everyone too. Indeed yes. Thanks for the creation TechnoRobbo. Fun to be had. Quote Link to comment Share on other sites More sharing options...
TrevorOutlaw Posted May 6, 2014 Share Posted May 6, 2014 Almost like polar inversion without the clutter. Clever. Quote Link to comment Share on other sites More sharing options...
TechnoRobbo Posted May 6, 2014 Author Share Posted May 6, 2014 (edited) Oooh. Now you can move the bean anywhere in the world you want to! Like. Honestly , I think that bean is weird. A city with architecture by Mies van der Rohe ,Frank LLoyd Wright and the Columbian Exposition legacy has a bean? Many thanks to david. pixey , doughty, lloyd, treveroutla and especially to Mottoman for the turkey homage. Red has pointed out that Alpha channel should be taken into consideration and I agree. I will publish have published an Alpha-friendly revision - Thanks Red (reps from me) Edited September 20, 2015 by TechnoRobbo Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
david.atwell Posted May 7, 2014 Share Posted May 7, 2014 Honestly , I think that bean is weird. A city with architecture by Mies van der Rohe ,Frank LLoyd Wright and the Columbian Exposition legacy has a bean? The bean is weird. But being close to it is a fascinating experience. Does calling it "cloud gate" make it better? ;-) Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
TechnoRobbo Posted May 7, 2014 Author Share Posted May 7, 2014 nah, doesn't help. It's still like hanging dogs playing poker at the Louvre Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
david.atwell Posted May 7, 2014 Share Posted May 7, 2014 Hey, that is one classy piece of artwork. Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.