JDK-8099221 : Use LinearConvolve shaders for Gaussian effects to share code and improve performance
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx1.2
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2009-03-27
  • Updated: 2015-06-16
  • Resolved: 2009-09-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
fx1.3Fixed
Related Reports
Relates :  
Description
In creating the new BoxBlur effects for Marina, a new generalized Linear Convolution shader was created which can apply a convolution kernel along a vector for each pixel in an image.

The Gaussian family of effects (GaussianBlur, Shadow, and MotionBlur) all use very similar operations, the only difference being the construction of the weights in the convolution kernel and sometimes the vector along which the weights are to be applied.  Each of these effects comes with its own set of peers that costs around 24K in the decora Jar files (including compression).

In addition, the need to support much larger convolution kernels led to a new way of encoding these kinds of effects into a shader that is computationally more efficient for larger sizes (almost 4 times as fast for a GaussianBlur of radius 63).  The new mechanism also implements a system whereby downscaling can be used to accelerate various linear convolutions by applying them to a smaller version of the input image if they are compatible with the method (all blurs tend to be compatible with the downscaling optimization).  Thus, there are 2 ways in which these various effects can run faster than using their existing custom shaders.

This move is a win-win situation with respect to code size and speed.
Comments
Note that converting MotionBlur over to the LC filters saved about 32K total space in the various decora-* jar files.
04-09-2009

The MotionBlur filter was converted over to use LinearConvolve and the last of the effect-specific gaussian code was purged from the system.
04-09-2009

The only remaining effect which can be ported over to the new LinearConvolve shaders is the MotionBlur effect. This is simple work, but it is too late to get it into Marina so I am moving this bug to target SoMa for this last remaining step.
01-05-2009

Shadow now uses the LinearConvolveShadow shaders. Over 24K worth of glsl, hlsl and obj files were removed from decora-ogl and decora-d3d jars. Performance is the same or better than the previous Shadow-specific shaders...
02-04-2009

GaussianBlur now uses the LinearConvolve shaders. 24K worth of glsl, hlsl and obj files were removed from decora-ogl and decora-d3d jars. Performance is the same or better than the previous GaussianBlur-specific shaders...
29-03-2009