uTexture

uv

);

By default, the image uses TileMode.clamp to determine how values outside
of the range of [0, 1] behave. Customization of the tile mode is not
supported and needs to be emulated in the shader.

Performance considerations

When targeting the Skia backend, loading the shader might be expensive since it
must be compiled to the appropriate platform-specific shader at runtime. If you
intend to use one or more shaders during an animation, consider precaching the
fragment program objects before starting the animation.

You can reuse a FragmentShader object across frames;
this is more efficient than creating a new FragmentShader for each frame.

For a more detailed guide on writing performant shaders,
check out Writing efficient shaders on GitHub.

Other resources

For more information, here are a few resources.

The Book of Shaders by Patricio Gonzalez Vivo and Jen Lowe