diff --git a/docs/ff-concepts/animations/imgs/convert-via-url.avif b/docs/ff-concepts/animations/imgs/convert-via-url.avif new file mode 100644 index 00000000..817ede4e Binary files /dev/null and b/docs/ff-concepts/animations/imgs/convert-via-url.avif differ diff --git a/docs/ff-concepts/animations/shaders.md b/docs/ff-concepts/animations/shaders.md index 7895499e..a9896a06 100644 --- a/docs/ff-concepts/animations/shaders.md +++ b/docs/ff-concepts/animations/shaders.md @@ -414,4 +414,174 @@ uniform float uTime; uniform float speed; uniform vec4 color; -``` \ No newline at end of file +``` + +## Use Shadertoy Shaders + +[Shadertoy](https://www.shadertoy.com/) hosts thousands of community-made GLSL fragment shaders such as animated backgrounds, glowing effects, liquid simulations, and more. Flutter supports custom fragment shaders through its `FragmentProgram` API, but Shadertoy shaders can't be dropped in directly: they use a different entry point, different uniform names, and several built-ins that Flutter doesn't recognize. + +The [Shadertoy to Flutter skill](https://github.com/FlutterFlow/shadertoy_to_flutter_skill) helps convert Shadertoy GLSL into Flutter-compatible `.frag` shaders. It rewrites the shader structure, maps Shadertoy uniforms to Flutter uniforms, handles texture/audio channels where possible, and produces a `.frag` file that can be uploaded into your FlutterFlow project. + +#### Step 1: Download Skill + +The skill teaches AI Agents how to convert Shadertoy shaders accurately and safely for Flutter. The skill used for this workflow is: **`shadertoy-to-flutter`**. Download it from the [GitHub repo](https://github.com/FlutterFlow/shadertoy_to_flutter_skill). + +The skill contains the following files: + +- `SKILL.md`: Main instruction file containing the shader conversion workflow and rules. +- `references/flutter_glsl_constraints.md`: Flutter GLSL limitations, unsupported features, uniform rules, and texture handling. +- `references/uniform_mapping.md`: Maps Shadertoy uniforms to Flutter equivalents (e.g. `iTime → uTime`). +- `references/templates.md`: Example fill/wrap shader templates and sample conversions. +- `references/noise_library.md`: Noise/hash helper functions for replacing Shadertoy noise textures. +- `scripts/package-skill.sh`: Packages the skill into a distributable zip file. + +#### Step 2: Install Skill + +You can use this skill with AI agents such as Claude, Codex, or another AI assistant that can read `SKILL.md` and follow its instructions. + +**Install in Claude** + +1. Open the **Claude Desktop app**. +2. Go to **Customize**. Select **Skills** from the left sidebar. +3. Click the **+** button at the top of the Skills panel. Choose **Upload a skill**. +4. Upload the Shadertoy skill as a .zip file or skill folder. + +The uploaded skill must include:`SKILL.md`. It can also include supporting folders such as: `references/` and `scripts/` + +