Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8099221

Use LinearConvolve shaders for Gaussian effects to share code and improve performance

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: fx1.2
    • Fix Version/s: fx1.3
    • Component/s: javafx
    • Labels:

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                flar Jim Graham
                Reporter:
                flar Jim Graham
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:
                  Imported: