Optimize shaders
CI / quality (push) Failing after 5m56s

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-04-21 17:40:21 +02:00
parent 37e0814483
commit 9564096a5c
40 changed files with 678 additions and 1442 deletions
+9 -31
View File
@@ -14,8 +14,7 @@ It exposes two widget layers:
- Position-driven rendering: visuals respond to tilt/input position with no internal time animation
- Generic wrapper API for any widget via `Shiny(child: ...)`
- Card API with `background`, `foreground`, `shape`, and drag tilt via `ShinyCard`
- Built-in sparkle presets including `none` (default), 8-point star, 5-point star, rectangle, diamond, hexagon, random polygon, and confetti
- Custom sparkle shapes via parameterized `SparkleShapeSpec` factories
- Four specialized material profiles backed by dedicated shader assets
- Global shader opacity control via `opacity`
- Cross-platform Flutter support (mobile, web, desktop)
@@ -62,7 +61,7 @@ ShinyCard(
controller: controller,
background: Container(color: const Color(0xFF1B2D4B)),
foreground: const Center(child: Text('HOLO')),
sparkleShape: SparkleShapeSpec.none,
profile: ShinyProfile.crackedIce,
opacity: 1.0,
)
```
@@ -78,37 +77,17 @@ Shiny(
)
```
## Sparkle Shapes
## Profiles
Use built-in sparkle presets:
Choose a precompiled material profile:
```dart
ShinyCard(
sparkleShape: SparkleShapeSpec.none,
profile: ShinyProfile.holographicSilver,
)
ShinyCard(
sparkleShape: SparkleShapeSpec.hexagon,
)
```
Or create your own parameterized shapes:
```dart
ShinyCard(
sparkleShape: SparkleShapeSpec.customStar(
points: 7,
innerRatio: 0.36,
),
)
Shiny(
sparkleShape: SparkleShapeSpec.customPolygon(
sides: 8,
aspectRatio: 1.2,
rotation: 0.2,
),
child: const SizedBox(width: 240, height: 120),
profile: ShinyProfile.superGoldVinyl,
)
```
@@ -123,13 +102,13 @@ final ShinyController controller = ShinyController(tiltStream: input.stream);
- `Shiny`: generic effect wrapper
- `ShinyCard`: shape + rotation + composition convenience widget
- `SparkleShapeSpec`: built-in and custom sparkle silhouette configuration
- `ShinyProfile`: specialized material presets mapped to dedicated shader assets
- `ShinyController`: optional source selection for tilt
- `SensorTiltController`: low-level sensor fusion stream utility
Important defaults:
- `sparkleShape` defaults to `SparkleShapeSpec.none` (no sparkles)
- `profile` defaults to `ShinyProfile.crackedIce`
- `opacity` defaults to `1.0`
## Platform Notes
@@ -147,8 +126,7 @@ See the package example app in `example/` for:
- Sensor-driven motion
- External stream override
- Custom card shape/background/foreground composition
- Built-in sparkle shape toggles in the demo UI
- User-defined sparkle shape presets using `SparkleShapeSpec`
- Profile switching in the demo UI
## Publishing Notes