Rick Brewster Posted November 22, 2022 Share Posted November 22, 2022 I've created some samples to show how to write effects using the new GPU plugin system in PDN 5.0. Download: PDNv5EffectSamples.2023.01.07.zip To install, extract the ZIP to your effect plugin folder. Do not move the files outside of their folder. GitHub repository (source code) Here's what's included. Some of these are genuinely fun, others are strictly for showing how to code certain things: Bandlimited Synthesis -- This was ported from a ShaderToy shader written in GLSL. Channel Blur -- This lets you select which channels are affected by a Gaussian Blur effect. This sample is mostly to show how to combine existing Direct2D effects in your own plugin. Drop Shadow -- This is mostly just a coding example. The app has a built-in Drop Shadow effect of its own now. Gaussian Bokeh -- This is another example on how to combine two built-in effects: Direct2D's Gaussian Blur, and Paint.NET's Bokeh blur. There's a slider to cross-fade between the two results. Hue Rotate -- This is another example on how to write a simple Direct2D-based GPU plugin. There is both a simple and advanced implementation, the latter illustrating a method for writing a GPU plugin that has improved performance. Night Circuit Shader -- This is a very complicated effect ported from a Shader Toy shader written in GLSL. Outlined Text with Shadow -- This is an example of how to use Direct2D and DirectWrite together. Polarized Mandelleaves -- This is a really fun one to play with. It combines a ShaderToy shader ported from GLSL and Polar Inversion. Rainbow -- A simple tutorial on how to draw a rainbow in Direct2D using a linear gradient brush. Random Noise -- Shows how to generate random numbers on the GPU. Ripple -- An example of how to write a distortion effect using SampleMapRenderer and multisample sub-pixel antialiasing. Shadow Around Selection -- An example of how to render outside of the active selection. Square Blur -- An example of how to write an effect plugin that uses a custom pixel shader and a transform mapper. Wavey Transform -- An example of how to write a distortion effect using SampleMapRenderer and multisample subpixel antialiasing. Zone Plate Shader -- An example of how to write an output-only (aka "Render") pixel shader effect. Implementation based on code by Clinton Ingram @saucecontrol. A "zone plate" is often used for testing systems (physical or digital) and image processing algorithms to see how they eliminate, preserve, or introduce aliasing artifacts. 2 Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted November 22, 2022 Author Share Posted November 22, 2022 I'll be updating these over the next few weeks, especially to include comments that better describe what's going on in the code. Feel free to post questions here, or file an issue on the GitHub repository. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted January 8 Author Share Posted January 8 Updated with a new build that works on the new Paint.NET 5.0 beta (build 8407) 1 2 Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Setnour6 Posted January 11 Share Posted January 11 (edited) I'm really hoping that more "around selection" plugins could be made, like "outline around selection", or just any outline plugin can be updated to include the "outside selection" function. This will help me with editing pixel art or make it easier to edit photos in some cases. I'm also thinking that a stamp tool or content aware stamp tool (which is in photoshop already) can be made. It's just some ideas I thought of, nothing too serious. Edited January 13 by Setnour6 Stamp tool already exists and I forgot about it 1 Quote Link to comment Share on other sites More sharing options...
BoltBait Posted January 11 Share Posted January 11 4 hours ago, Setnour6 said: I'm really hoping that more "around selection" plugins could be made, like "outline around selection", or just any outline plugin can be updated to include the "outside selection" function. This will help me with editing pixel art or make it easier to edit photos in some cases. I already include this in my plugin pack. Download here: https://forums.getpaint.net/BoltBaitPluginPack After install, look at Effects > Selection > Outline Selection... 1 Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game 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.