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...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.