{"id":13552737,"url":"https://github.com/monster555/flutter_shader_demo","last_synced_at":"2026-01-07T09:56:34.463Z","repository":{"id":205219991,"uuid":"713666215","full_name":"monster555/flutter_shader_demo","owner":"monster555","description":"Discover the captivating world of fragment shaders in Flutter through this cool demo.","archived":false,"fork":false,"pushed_at":"2023-11-03T04:42:07.000Z","size":92,"stargazers_count":27,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-04T00:33:04.826Z","etag":null,"topics":["flutter","flutter-web","fragment-shaders","glsl","shaders","ui-challenge"],"latest_commit_sha":null,"homepage":"","language":"GLSL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monster555.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-03T01:44:38.000Z","updated_at":"2024-10-06T03:51:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c4e304c-4e45-415d-a686-6f1d501d8fa5","html_url":"https://github.com/monster555/flutter_shader_demo","commit_stats":null,"previous_names":["monster555/flutter_shader_demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monster555%2Fflutter_shader_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monster555%2Fflutter_shader_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monster555%2Fflutter_shader_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monster555%2Fflutter_shader_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monster555","download_url":"https://codeload.github.com/monster555/flutter_shader_demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246938937,"owners_count":20857916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","flutter-web","fragment-shaders","glsl","shaders","ui-challenge"],"created_at":"2024-08-01T12:02:08.950Z","updated_at":"2026-01-07T09:56:34.423Z","avatar_url":"https://github.com/monster555.png","language":"GLSL","funding_links":["https://www.buymeacoffee.com/danicoy"],"categories":["GLSL"],"sub_categories":[],"readme":"# Flutter Fragment Shaders Demo\nThis repository contains a demo application showcasing the integration of fragment shaders in Flutter.\n\n\n\nhttps://github.com/monster555/flutter_shader_demo/assets/32662133/b05fa456-72e7-4381-8a30-114e01b00398\n\n\n\nLike this project? Consider supporting its upkeep with a coffee. Your generosity is appreciated! ☕\n\n\u003ca href=\"https://www.buymeacoffee.com/danicoy\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n\n## Introduction\nFragment shaders are a type of shader used in 3D graphics for shading pixels. They can be used to create stunning visual effects and manipulate pixels in real-time applications.\n\n## Setup\nTo use custom shaders in your Flutter project, you need to add them to your pubspec.yaml file. Here’s how you can do it:\n\n- **Create the Shader File**: Write your shader program in a file with a `.frag` extension. This file contains the GLSL code for your custom shader.\n\n- **Add the Shader to `pubspec.yaml`**: In your `pubspec.yaml` file, you need to add a `shaders` section under the `flutter` section. Here, you list all the shader files (with their paths) that you want to include in your project. For example:\n\n```yaml\nflutter:\n  shaders:\n    - shaders/myshader.frag\n```\n\nIn this example, `myshader.frag` is the shader file located in the `/shaders` directory of your project\n\n- **Create a Custom Painter**: In your Dart code, create a custom painter that extends `CustomPainter`. This custom painter will use the shader when painting.\n\n## Usage\nHere are some examples of how to use fragment shaders in your Flutter project:\n\n- **Loading the Shader**: To load a shader into a `FragmentProgram` object at runtime, use the `FragmentProgram.fromAsset` constructor. The asset’s name is the same as the path to the shader given in the `pubspec.yaml` file. The `FragmentProgram` object can then be used to create one or more `FragmentShader` instances.\n- **Using the FragmentShade**r: A `FragmentShader` object represents a fragment program along with a particular set of uniforms (configuration parameters). The available uniforms depend on how the shader was defined. In this example, I'm using the `setFloat` method on my `FragmentShader` instance to set these uniforms.\n\n## Resources\nFor more information on writing and using fragment shaders in Flutter, check out the [Flutter documentation on fragment shaders](https://docs.flutter.dev/ui/design/graphics/fragment-shaders).\n\n## Acknowledgements\nThe shaders used in this demo were not written by me. They were authored by the following individuals:\n\n- [Galaxy](https://www.shadertoy.com/view/MdXSzS): Authored by [Dave Hoskins](https://www.shadertoy.com/user/Dave_Hoskins)\n- [Fire Heart](https://www.shadertoy.com/view/3sSXRt): Authored by [lz](https://www.shadertoy.com/user/lz)\n- [Fire](https://www.shadertoy.com/view/4tlSzl): Authored by [Shane](https://www.shadertoy.com/user/Shane)\n- [Heartbeat](https://www.shadertoy.com/view/csc3W2): Authored by [mushroom](https://www.shadertoy.com/user/mushroom)\n\nAll credit for the shader code goes to them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonster555%2Fflutter_shader_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonster555%2Fflutter_shader_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonster555%2Fflutter_shader_demo/lists"}