Skip to content
Snippets Groups Projects

qt: optimize the frosted glass effect by not using second pass layering

Merged Fatih Uzunoğlu requested to merge fuzun/vlc:qt/optimizefrostedglasseffect into master
  1. Dec 15, 2024
    • Fatih Uzunoğlu's avatar
      qt: optimize the frosted glass effect by not using second pass layering · 988b7bb2
      Fatih Uzunoğlu authored and Steve Lhomme's avatar Steve Lhomme committed
      Currently layering (second pass) is used to render
      the blurred source offscreen, and then apply the
      rest of the effects (tint, exclusion and noise) to
      the offscreen source when drawing the result in the
      interface. Note that the first pass layering for the
      source item is necessary for blurring and can not
      be disabled.
      
      This is not ideal, because layering requires
      allocating resources for offscreen rendering.
      
      The most ideal solution would be to modify
      the fragment shader of the blur effect. But we
      currently do not do run time shader compilation,
      and MultiEffect does not accept overriding its
      shader effect.
      
      At the same time, FastBlur from Qt 5 Compat is
      used as fallback when Qt Quick Effects is not
      available. In a hypothetical scenario where we
      could override the fragment shader, it would
      mean that we would need to handle these two
      cases differently because MultiEffect and
      FastBlur use different shaders.
      
      As a workaround, I propose having an underlay
      filter rectangle that acts as exclusion (due
      to opacity) and colorization (tint), and having
      an overlay as the noise layer.
      988b7bb2
Loading