搜索插件、代码仓与 APP 分类

插件详情v0.1.5

flutter_shaders

一组用于在 Flutter 中使用 FragmentProgram API 的实用工具。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
163万
喜欢数
134
Pub 分数
150

安装插件

flutter pub add flutter_shaders

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

flutter_shaders 是一个 Flutter 包,提供用于利用 FragmentProgram API 创建自定义着色器和高级视觉效果的工具。它使开发者能够跨多个平台实现动态背景效果、复杂的渐变以及实时图形变换。该包通过提供辅助函数和抽象,简化了着色器集成,使开发者无需深入掌握底层知识即可应用复杂的片段着色器。非常适合需要具有动画或交互式图形的视觉丰富界面的应用程序。

适合场景

  • 创建动画背景
  • 实现自定义渐变效果
  • 使用着色器构建交互式 UI 元素
  • 通过实时图形增强应用视觉效果
  • 开发沉浸式游戏界面

主要特点

  • 与 FragmentProgram API 的轻松集成
  • 跨平台着色器支持
  • 预构建的实用函数,用于常见效果
  • 对动态着色器参数的支持
  • 针对动画优化的性能

适合对象

  • 寻求高级视觉效果的UI设计师
  • 开发沉浸式应用或游戏的开发者
  • 专注于高端移动和网络图形
  • 前端工程师探索创意渲染技术

使用建议

  • 需要了解 GLSL 着色器
  • 可能会增加应用的复杂性和构建时间
  • 不适合简单的静态UI
  • 性能取决于着色器优化
  • 有限的着色器逻辑调试工具

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

flutter_shaders

A collection of utilities to make working with the FragmentProgram API easier.

Available Shaders

This package includes a number of shaders that can be optionally included into your application by declaring them in the pubspec.yaml:

Pixelation

The pixelation shader reduces the provided sampler to MxN samples. This can be used with the [AnimatedSampler] widget. The required uniforms are:

Floats:

  • The number of pixels in the X coordinate space.
  • The number of pixels in the Y coordinate space.
  • The width of the sampled area.
  • The height of the sampled area. Samplers:
  • The child widget, captured as a texture.

To include this shader in your application, add the following line to your pubspec.yaml

flutter:
  shaders:
    - packages/flutter_shaders/shaders/pixelation.frag

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目