dopestuff Posted June 19, 2015 Share Posted June 19, 2015 Hi. I'm trying to write my first plugin that reproduces the steps in this video: I have everything set up in Visual Studio, the plugin loads fine and so far everything's good. But I'm not sure where to begin. My OnRender() sub is empty. I don't know where to look for documentation on the effect class.Could somebody give me a push in the right direction or tell me what functions I need to call do to what. I would appreciate it a lot. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted June 19, 2015 Share Posted June 19, 2015 You should probably start by reading this series of tutorials: http://www.BoltBait.com/pdn/CodeLab/Help Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Red ochre Posted June 19, 2015 Share Posted June 19, 2015 There is already a chromatic (color) aberation plugin - here http://forums.getpaint.net/index.php?/topic/19513-color-aberation-ymd100726/ Just thought I'd mention it ... I highly recommend writing your own plugins though! Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
MJW Posted June 19, 2015 Share Posted June 19, 2015 (edited) Sometimes it's not easy to find the functions you need. For what you want to do, you should know about src.GetBilinearSample(x, y), src.GetBilinearSampleClamped(x, y), and src.GetBilinearSampleWrapped(x, y). "src" is the source surface. It could be a different surface, but src is the one you'll probably use. "x" and "y" are floating point numbers representing the image coordinates of the point you want to fetch. "Clamped" and "Wrapped" refer to how coordinates outside the image range are handled. For each color channel, you'll need to add float offsets (converted from input-variable doubles) to float versions of the image x and y coordinates (the for loop variables), then get the pixel, as a ColorBgra. If you only want to allow integer shifts, then you can directly index into the src surface. This has the advantage of avoiding blurring caused by bilinear interpolation at non-integer shifts, but the disadvantage of allowing only integer shifts. Normally, there's little reason to use the slower GetBilinearSample calls if the coordinate arguments only take integer values. Edited June 19, 2015 by MJW Quote 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.