Skip to content

[Impeller] ImageFilter.shader implicit backdrop sampler cannot be configured with FilterQuality #188365

Closed

Description

@sdegenaar

Use case

When using BackdropFilter with a custom FragmentShader via ImageFilter.shader(), the engine implicitly captures the backdrop and binds it to the shader's first sampler slot.

Currently, there is no Dart API to configure the FilterQuality of this implicitly bound texture. Impeller defaults the sampler to Nearest-Neighbor.

For high-fidelity visual effects (e.g., real-time glass refraction, lens distortion, or liquid effects), nearest-neighbor sampling of the backdrop causes severe stair-step aliasing on high-contrast background edges when the UV coordinates are distorted by the shader.

Proposal

Expose a way to configure the FilterQuality for the implicitly bound texture when using ImageFilter.shader(). This could be done by:

  1. Adding a FilterQuality parameter to ImageFilter.shader(...)
  2. Or allowing BackdropFilter / BackdropFilterLayer to pass a FilterQuality that applies to its generated texture.

Note: This is an architectural gap analogous to #77165 which notes the exact same missing parameter for ShaderMask.

Workaround

Currently, the only workaround is to manually implement a 4-tap bilinear filter inside the GLSL fragment shader, which incurs a 4x texture sampling performance penalty on every pixel:

// Manual bilinear workaround inside the FragmentProgram
vec2 px = uv * physSize - 0.5;
vec2 p0 = floor(px);
vec4 c0 = texture(tex, (p0 + vec2(0.5, 0.5)) * invPhys);
// ... + 3 more fetches and mix() ...

Having engine-level control over the sampler's FilterQuality would eliminate the need for this expensive workaround.

Filing this new issue ensures it gets triaged by the team currently working on Impeller shaders, rather than getting buried at the bottom of a 2021 Skia thread!

Cheers

Activity

  1. suryaKommana2662 commented on Jun 23, 2026

    @suryaKommana2662
    Contributor

    @sdegenaar Thanks for the detailed proposal and use case. Routing this to the team-engine for further investigation.

  2. added
    engineflutter/engine related. See also e: labels.
    e: impellerImpeller rendering backend issues and features requests
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Jun 23, 2026
  3. added
    P2Important issues not at the top of the work list
    on Jun 29, 2026
  4. gaaclarke commented on Jun 29, 2026

    @gaaclarke
    Member

    fyi @b-luk I know we did some work with filter quality at some point. This looks like another case where we are working with an implicitly bound texture that wouldn't have been covered.

  5. github-actions commented on Aug 14, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Fluttere: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions