Repository navigation
Description
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:
- Adding a FilterQuality parameter to ImageFilter.shader(...)
- 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
suryaKommana2662 commentedon Jun 23, 2026
@sdegenaar Thanks for the detailed proposal and use case. Routing this to the
team-enginefor further investigation.gaaclarke commentedon Jun 29, 2026
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.
[Impeller] Add filterQuality support to ImageFilter.shader (flutter#1…
github-actions commentedon Aug 14, 2026
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 -vand a minimal reproduction of the issue.