fragment_shader_example

A simple example of animating a custom shader in a Flutter app

BSD-3-CLAUSE License

Stars
23
Committers
2

fragment_shader_example

A simple example of a custom shader in a Flutter app.

The shader under shaders/example.frag computes a color for each pixel that depends only on the position and the "time". The time is supplied as a uniform to the shader, and so we can use a CustomPainter to animate it.

This example uses the API as found in the 3.3 stable release of Flutter. After this PR lands, the API will be different. Please see the TODO comments in the source code for details of what the migration looks like.

To run on platforms other than macOS, first run the appropriate flutter create command to generate their platform specific files.