搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案