TechnoRobbo Posted June 5, 2013 Share Posted June 5, 2013 (edited) Technorobbo's Fish Eye 2.2 v2.2 adds color cast to highlight and specular control v2.1 fixes a bug in the highlight V2.0 adds shadow, rotation and specular highlight It's not a Bulge Filter. It takes your image, creates a Pixel Cloud then maps it via the Pythagorean theorem. Then renders it using a standard 3D Mapping algorithm. Here is a Youtube tutorial http://youtu.be/DOOwh8ul3gc V2 Demo http://youtu.be/oqaHRlxdARs Here's the code: Hidden Content: // Submenu: Distort // Name: TR's Fish Eye // Title: Fish Eye - v2.2 // Author: TechnoRobbo // URL: http://www.technorobbo.com #region UICode double Amount1 = 0.25; // [0.01,1] Control Pair<double, double> Amount2 = Pair.Create( 0.0 , 0.0 ); // Rotate Pair<double, double> Amount3 = Pair.Create( 0.0 , 0.0 ); // Light Source double Amount4 = 0; // [0,2] Spot Light double Amount5 = 2; // [0,5] Light Intensity double Amount6 = 0; // [0,1.5] Highlight double Amount7 = 1; // [0.01,10] Specularity ColorBgra Amount8 = ColorBgra.FromBgr(0,0,0); // Color Cast #endregion private ColorBgra getblend(int x, ColorBgra a, ColorBgra { UserBlendOp bop = new UserBlendOps.NormalBlendOp(); switch (x) { case 0: bop = new UserBlendOps.NormalBlendOp(); // Normal break; case 1: bop = new UserBlendOps.MultiplyBlendOp(); // Multiply break; case 2: bop = new UserBlendOps.AdditiveBlendOp(); // Additive break; case 3: bop = new UserBlendOps.ColorBurnBlendOp(); // Color Burn break; case 4: bop = new UserBlendOps.ColorDodgeBlendOp(); // Color Dodge break; case 5: bop = new UserBlendOps.ReflectBlendOp(); // Reflect break; case 6: bop = new UserBlendOps.GlowBlendOp(); // Glow break; case 7: bop = new UserBlendOps.OverlayBlendOp(); // Overlay break; case 8: bop = new UserBlendOps.DifferenceBlendOp(); // Difference break; case 9: bop = new UserBlendOps.NegationBlendOp(); // Negation break; case 10: bop = new UserBlendOps.LightenBlendOp(); // Lighten break; case 11: bop = new UserBlendOps.DarkenBlendOp(); // Darken break; case 12: bop = new UserBlendOps.ScreenBlendOp(); // Screen break; case 13: bop = new UserBlendOps.XorBlendOp(); // Xor break; default: bop = new UserBlendOps.NormalBlendOp(); break; } return bop.Apply(a, ; } void Render(Surface dst, Surface src, Rectangle rect) { Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); double CenterX = ((selection.Right - selection.Left) / 2)+selection.Left; double CenterY= ((selection.Bottom - selection.Top) / 2)+selection.Top; double offx =0; double offy =0; double rady = (selection.Bottom - selection.Top) / 2; double radx = (selection.Right - selection.Left) / 2; double rotateX=Amount2.First * CenterX; double rotateY=Amount2.Second * CenterY; double sourceX=Amount3.First * CenterX + CenterX; double sourceY=Amount3.Second * CenterY + CenterY; double gamma = Amount5 * 255; double wide=Amount4; double hilite = Math.Pow(Amount6,Amount7); double tmpy =0; double tmpx =0; double z=0; double tmp=0; double zp= Math.Pow((double) Amount1,2) * radx * 8; ColorBgra cast = Amount8;//getblend(12,ColorBgra.White,Amount8); ColorBgra CP; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; tmpy=y-CenterY; tmpx=Math.Sqrt(rady*rady-tmpy*tmpy); for (int x = rect.Left; x < rect.Right; x++) { if (IsCancelRequested) return; double spread = Math.Sqrt(Math.Pow(x - CenterX,2) + Math.Pow(y - CenterY,2)); double Light = Math.Sqrt(Math.Pow(x - sourceX,2) + Math.Pow(y - sourceY,2)) * wide ; Light=(Light>CenterY)?1:Light/CenterY; double hLight = Math.Sqrt(Math.Pow(x - sourceX,2) + Math.Pow(y - sourceY,2)); hLight =(hLight >CenterY)?1:hLight /CenterY; tmp=(double)x-CenterX; z = zp + Math.Sqrt(tmpx*tmpx-tmp*tmp); offx = tmp * zp / z + CenterX + rotateX; tmp=(double)y-CenterY; offy= tmp * zp / z + CenterY + rotateY; CP= src.GetBilinearSampleWrapped((float)offx,(float)offy); double l,lr,lg,lb; lr =(1 - Math.Pow(hLight , hilite)) * cast.R; lr=(lr>255)?255:(lr<0)?0:lr; lg =(1 - Math.Pow(hLight , hilite)) * cast.G; lg=(lg>255)?255:(lg<0)?0:lg; lb =(1 - Math.Pow(hLight , hilite)) * cast.B; lr=(lb>255)?255:(lb<0)?0:lb; ColorBgra CH = ColorBgra.FromBgr((byte)lb,(byte)lg,(byte)lr); CP=getblend(12,CP,CH);//was 12 l= (1 - Math.Sqrt(Light)) * gamma; l=(l>255)?255:(l<0)?0:l; ColorBgra CL = ColorBgra.FromBgr((byte)l,(byte)l,(byte)l); CP=getblend(1,CP,CL); if (spread>(CenterY-1))CP.A=32; if (spread>(CenterY-2))CP.A=128; if (spread>CenterY)CP.A=0; dst[x,y]=CP; } } } Fisheye.zip Edited September 19, 2015 by TechnoRobbo 2 5 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 June 5, 2013 Share Posted June 5, 2013 Nice! It's quick too. Great job. 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...
TechnoRobbo Posted June 5, 2013 Author Share Posted June 5, 2013 Thank You 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...
Liquify Posted August 14, 2013 Share Posted August 14, 2013 awesome, thanks. Quote Link to comment Share on other sites More sharing options...
barbieq25 Posted August 14, 2013 Share Posted August 14, 2013 Looks good to me. Downloaded Quote Knowledge is no burden to carry. April Jones, 2012 Gallery My DA Gallery Link to comment Share on other sites More sharing options...
TechnoRobbo Posted February 22, 2015 Author Share Posted February 22, 2015 Version 2.0 Ready for download V2.0 adds shadow, rotation and specular highlight 3 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...
Goonfella Posted February 22, 2015 Share Posted February 22, 2015 Looks like Shape3D has some serious competition at last! Awesome TR. Downloading right now. :beer: Quote Please feel free to visit my Gallery on PDNFans And my Alternatives to PDN Link to comment Share on other sites More sharing options...
TechnoRobbo Posted February 22, 2015 Author Share Posted February 22, 2015 Sorry GoonfFella had a bug incorrectly linking hi-lite to shadow Version 2.1 ready for download 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...
nitenurse79 Posted February 22, 2015 Share Posted February 22, 2015 Great new update Mister Techno Robbo. would be cool if Box and Cylinder shapes could be implimented too Quote Link to comment Share on other sites More sharing options...
TechnoRobbo Posted February 22, 2015 Author Share Posted February 22, 2015 Thank You Miss Nite Nurse 79, Make sure you have version 2.1 highlight bug fixed 1 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...
racerx Posted February 23, 2015 Share Posted February 23, 2015 This update is "Eye Popping"..... 1 Quote Link to comment Share on other sites More sharing options...
TechnoRobbo Posted February 23, 2015 Author Share Posted February 23, 2015 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...
Seerose Posted February 23, 2015 Share Posted February 23, 2015 TR! Thank you for these new version plugin. 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 February 24, 2015 Author Share Posted February 24, 2015 V2.2 Ready for Download v2.2 adds color cast to highlight and specular control 1 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...
barbieq25 Posted February 24, 2015 Share Posted February 24, 2015 Awesome! Thanks so much Quote Knowledge is no burden to carry. April Jones, 2012 Gallery My DA Gallery Link to comment Share on other sites More sharing options...
TechnoRobbo Posted February 24, 2015 Author Share Posted February 24, 2015 You're welcome BBQ 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...
racerx Posted February 27, 2015 Share Posted February 27, 2015 I'm liking this plugin for quick 3-D work. 1 Quote Link to comment Share on other sites More sharing options...
skullbonz Posted February 27, 2015 Share Posted February 27, 2015 Wow, I just saw this and had to update. Love it TR, great update,thanks for all you do. Quote http://forums.getpaint.net/index.php?/topic/21233-skullbonz-art-gallery Link to comment Share on other sites More sharing options...
TechnoRobbo Posted February 28, 2015 Author Share Posted February 28, 2015 Thanks RacerX and Skully 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...
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.