Jump to content

Bruce Bowyer-Smyth

Members
  • Posts

    182
  • Joined

  • Last visited

Posts posted by Bruce Bowyer-Smyth

  1. I thought I would throw this in here just in case there is a race condition against a disposed object. Although it could be unrelated.

    It only happened once and I think I closed the app before it was fully loaded, but again not really sure (Go Team! :)). Version 3.5.6

    Exception details:

    System.ObjectDisposedException: Cannot access a disposed object.

    Object name: 'PaintDotNet.Document'.

    at PaintDotNet.IsDisposedExtensions.VerifyNotDisposed[T](T theObject) in D:\src\pdn\pdn_35x\src\Base\IsDisposedExtensions.cs:line 24

    at PaintDotNet.Document.get_Layers() in D:\src\pdn\pdn_35x\src\Data\Document.cs:line 820

    at PaintDotNet.Controls.LayerControl.TearDownOldDocument() in D:\src\pdn\pdn_35x\src\PaintDotNet\Controls\LayerControl.cs:line 288

    at PaintDotNet.Controls.LayerControl.Workspace_ActiveDocumentWorkspaceChanging(Object sender, EventArgs e) in D:\src\pdn\pdn_35x\src\PaintDotNet\Controls\LayerControl.cs:line 521

    at System.EventHandler.Invoke(Object sender, EventArgs e)

    at PaintDotNet.Controls.AppWorkspace.OnActiveDocumentWorkspaceChanging() in D:\src\pdn\pdn_35x\src\PaintDotNet\Controls\AppWorkspace.cs:line 978

    at PaintDotNet.Controls.AppWorkspace.set_ActiveDocumentWorkspace(DocumentWorkspace value) in D:\src\pdn\pdn_35x\src\PaintDotNet\Controls\AppWorkspace.cs:line 774

    at PaintDotNet.Controls.AppWorkspace.RemoveDocumentWorkspace(DocumentWorkspace documentWorkspace) in D:\src\pdn\pdn_35x\src\PaintDotNet\Controls\AppWorkspace.cs:line 899

    at PaintDotNet.Actions.CloseAllWorkspacesAction.PerformAction(AppWorkspace appWorkspace) in D:\src\pdn\pdn_35x\src\PaintDotNet\Actions\CloseAllWorkspacesAction.cs:line 156

    at PaintDotNet.Controls.AppWorkspace.PerformAction(AppWorkspaceAction performMe) in D:\src\pdn\pdn_35x\src\PaintDotNet\Controls\AppWorkspace.cs:line 1878

    at PaintDotNet.Dialogs.MainForm.OnClosing(CancelEventArgs e) in D:\src\pdn\pdn_35x\src\PaintDotNet\Dialogs\MainForm.cs:line 575

    at System.Windows.Forms.Form.WmClose(Message& m)

    at PaintDotNet.PdnBaseForm.OurWndProc(Message& m) in D:\src\pdn\pdn_35x\src\Core\PdnBaseForm.cs:line 1374

    at PaintDotNet.Dialogs.MainForm.WndProc(Message& m) in D:\src\pdn\pdn_35x\src\PaintDotNet\Dialogs\MainForm.cs:line 97

    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

  2. Pleabo, The image size comes from the metafile itself. They typically contain recommended dimensions to place the vector image into.

    I have considered displaying an import settings window on file open where you could set the scaling and background behaviour but thought that it may become annoying being shown every time. Maybe when the Paint.NET v4 settings dialog comes along I can do something there.

    File type plugins get handed the file that was opened and return a Paint.NET document based off that file. I don't think I can access any other application state like the currently open canvas.

  3. I got a huge improvement on motion blur even on my relatively weak 8600gts. I 100% believe that 31,700% increase figure.

    Glad you like it. Performance difference is dependent on the cpu and gpu combination but as you say the weaker video card still far out performs your quad core. Nice.

    The particular figure I posted was from my dual core and 8800GTS setup and a 4800x6400 image. 16m 47.6 seconds versus 3.166 seconds.

  4. I have released a new version over on the published thread. For the motion and gaussian blur I have implemented a completely custom region slicing if the effect is being run against a whole image. With just this change the 960x1280 image goes from 426ms to 189ms. So very important to keep the GPU pipeline full and avoid stalls by copying the results back too often.

    Large image is up to 31,725% faster.

  5. Hardware Accelerated Blur Pack uses your video card’s GPU to process images at a potentially huge performance leap. The blurs in this pack are modelled after the built in Paint.NET effects. Differences have been noted below.

    System Requirements
    Note: These additional requirements are for this plugin pack only. They are not required for paint.net use in general.

     

    • Windows 8, Windows 7 or Windows Vista with the DirectX 11 platform update (x86, x64).
      (Win XP is NOT supported as it does not have DX11)
    • Latest Video Drivers from NVIDIA or AMD/ATI
    • DirectX 10 or later video card that supports DirectCompute (see troubleshooting section for how to determine this)

     

    Installation
    Extract all files from the zip file into the Paint.NET Effects folder.

    Download for Paint.net v4.3 or later
    >>> Hardware Accelerated Blur Pack <<<

    Included Effects
    Motion Blur (up to 54,800% faster!)

     

    • Added Edge Behaviour option

     

    Radial Blur (up to 12,300% faster)

     

    • No quality option but it is equivalent to high-quality "5" in the standard Paint.NET blur.

     

    Zoom Blur (up to 5,300% faster)

    Gaussian Blur (up to 3,000% faster)

     

    • Main improvement is for large images or radius
    • Added Blur Dimensions option (Horizontal and Vertical, Horizontal Only, Vertical Only)
    • Added Edge Behaviour option

     

    Channel Blur (new effect)

     

    • A separate and unique gaussian blur for each color channel
    • Each channel has it’s own independent radius option

     

    Troubleshooting
    Device creation error message

     

    • Firstly make sure you have up to date video drivers
       
    • Download GPU-Z and confirm that the DirectCompute checkbox is checked. If it isn’t you may have an unsupported video card. This means for NVIDIA you need an 8 series or later. For AMD/ATI the HD 4700 series or later. Intel HD Graphics 4000/2500 may be supported but I haven't tested that.

     

    Out of Memory error message

    • You now have a reason for that hardware upgrade. The image needs to fit into the memory of the video card. The amount of a ram you have determines the size of the image these effects can process.

     

    Version History
    3.2.0 - Support for PDN 4.3.

    3.1.0 - Fix for Radial Blur in PDN 4 and images with sub-selections.

    3.0.0 - PDN 4 compatible. Switched to use SharpDX.

    2.4.0 - Bug fix for "tall" motion blurs
    2.3.0 - Bug fix for partial image width selections

    2.2.0 - Fixed plugin load wanring. Fixed some blurs being off by half a pixel. Added support for Win 8 software device driver.

    2.1.0 - Gaussian, Motion and Channel blurs can handle any sized image. Faster zoom.
    2.0.0 - Faster Radial, motion and zoom.
    1.0.7 - Increased perf on small to medium sized images for motion and gaussian blur

    • Like 1
    • Upvote 1
  6. Ok new build is up. Not wanting to give up the texture performance for the most common scenarios I have made it switch to the StructuredBuffer only when the width or height is greater than 8k. This can certainly be done a lot better but for a V1 release it's workable.

    Let me know how it goes as I don't have enough video memory to process the full 70 megapixel image.

  7. Just give me an HLSL fragment in place of OnRender().

    If you can figure out an generic way to pass parameters then that would be a great setup.

    All of the effects are giving me an E_INVALIDARG error in a message box when I try to apply them to this image (15204 x 4620 px)

    Hmm DX11 has a texture dimension limit of 16k but it turns out that when running on DX10 hardware the limit is still 8k. I may have to bring back the StructuredBuffer for large images...

  8. I knew you’d be back Rick. :D Let me know if you decide to go ahead with it and want to trial anything.

    With point-and-click cameras now averaging about 12 megapixels and climbing it may be soon become a requirement for some types of effects seeing that CPU’s haven’t been keeping up with that race.

    I did actually check out how installation would go but pretty quickly ran into all the troubles that Promit from SlimDX goes on about in this rant. It would have been nice to pre-check a few things like driver versions and display a "<Product Name> could perform faster on your computer" type message but that is one of the trade-offs.

    Here's hoping that the installer team have resolved this already and we can expect a "Web Deployment Package" style installer in the future?

  9. Well I'm back from my dependency squashing expedition with some pretty favourable results. Apart from the Vista platform update there is now nothing to install.

    I’ve created a custom build of SlimDX that just contains D3D11 and is repointed to the DirectX11 RTM version so that neither it nor the DirectX February update needs to be installed. The custom build can just be copied to the effects folder.

    The package now includes the effect dll, and 2 SlimDX dll’s (x86 and x64). Extract all of them into your Paint.NET Effects folder.

    I have also fixed up the channel blur alpha handling and removed the reference driver fall back as that was basically not an option.

    Let me know if you have any issues with this build and I will release it to the general population if all is well.

  10. Yes that was my thinking as well due to the huge amount of sampling and the scattered reads. Also when the radius increased the performance went down even though the same amount of work was being done. Probably thrashing the limited cache.

    But every roadblock has a detour and this one's name is... Texture2D and the texture cache. If what I have read is correct then StructuredBuffer doesn't use the texture cache. Treating the source image as a texture has meant that caching is better and I could remove the calculations to convert a point to a position in a 1D array and also the manual bit shifting on the pixel read. The performance is now a more respectable constant 4400% when the radius is increased so this definitely looks like the way to go.

    The same technique on the large image motion blur takes it up to 27K%. After implementing the code for proper alpha averaging that comes back down to 25K% but still a win there.

×
×
  • Create New...