JDK-8098164 : Improve performance of Gaussian-based effects
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx1.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2009-01-07
  • Updated: 2015-06-12
  • Resolved: 2014-06-18
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
We should provide hand-tuned software versions of the Gaussian-based effects.  Possibilities include:
  - simulating a larger Gaussian kernel with multiple passes of a smaller kernel
  - simulating a Gaussian kernel with a box blur (for the software implementations mainly)


Comments
It is not clear that this technique would add any value after the work done for RT-13275. Closing as "will not fix".
18-06-2014

The fixes for RT-13275 allow us to handle any arbitrarily large scaled gaussian blur size (the maximum gaussian radius is still limited by the APIs, but with scaling that blur can be arbitrarily large in device space). That fix obviates the need for these multi-pass blurs as a method for expanding the supported blur sizes. It is not likely that a multi-pass Gaussian is needed in the case where we hit our internal upper limit of how large of a LinearConvolve kernel we can support since at that kernel size, a scaled Gaussian blur is fairly indistinguishable from a true blur at the indicated resolution.
18-06-2014

Pushing out to post-SoMa (unspecified) release as further improvements are possible, but we've reached a knee in the cost/benefit curve so I won't commit to a schedule for further optimizations at this time.
22-10-2009

A bit of work was done on this for the Marina release including: - Moving to a new (slightly faster) LinearConvolve set of shaders for calculating Gaussian convolves - Adding support for pre-scaling a source image prior to applying a blur convolution. - The GaussianShadow effect currently takes advantage of this in a minimal sense. - More work is needed on investigating how much we can rely on this mechanism for a quality/perf tradeoff. - Providing BoxBlur and BoxShadow and allowing the FX classes to choose which algorithm is used on the fly. - Switching to BoxShadow by default for the DropShadow, InnerShadow, and Shadow FX classes for performance on SW platforms Further work is needed, but this is the end of the line on the work that can get in for Marina so I am retargetting this issue to SoMa to track future improvements.
01-05-2009

Another possible approach to fast Gaussians is to use a fast fourier transform to convert the image and kernel into the frequency domain and use multiplication rather than convolution.
08-01-2009

Multi-pass gaussian blurs are not cost effective in terms of producing a larger gaussian since the effect of performing multiple gaussians only goes up with the square root of the sum of the squares of the individual passes. Thus, applying a gaussian of radius N twice produces the effect of a guassian of radius 1.4*N. The cost of a gaussian blur operation is O(2*r*w*h) so 2 blurs of radius N are O(4*N*w*h) and the single blur of radius 1.4*N is O(2.8*N*w*h) so the single blur should be faster. Still, this effect can be used to perform gaussians that are larger than the largest radius we can support in a GPU shader without having to resort to software using the iterative formula: // If N is the desired radius: N2 = N * N while (N2 > MAXR * MAXR) { blur(MAXR); N2 -= MAXR * MAXR; } blur(sqrt(N2));
08-01-2009