@lovo/matter 0.5.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -6
- package/dist/index.cjs +446 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -6
- package/dist/index.d.ts +82 -6
- package/dist/index.js +429 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @lovo/matter
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 8d9d4ad: Rename the `filmGrain` primitive to `grain`.
|
|
8
|
+
|
|
9
|
+
The `filmGrain(intensity, timeOffset?)` primitive is now exported as `grain` with
|
|
10
|
+
an identical signature and behavior. The Tier 1 `<FilmGrain>` component (delivered
|
|
11
|
+
via the CLI) is likewise renamed to `<Grain>`, and its `film-grain` registry slug
|
|
12
|
+
is now `grain`.
|
|
13
|
+
|
|
14
|
+
**Migration:** one-pass find-and-replace.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
// Before
|
|
18
|
+
import { filmGrain } from '@lovo/matter';
|
|
19
|
+
const g = filmGrain(0.08);
|
|
20
|
+
|
|
21
|
+
// After
|
|
22
|
+
import { grain } from '@lovo/matter';
|
|
23
|
+
const g = grain(0.08);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 0.6.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- 24ec05d: Add color-space-aware interpolation. `colorRamp` and the new `mixColor` primitive
|
|
31
|
+
accept `colorSpace` ('linear' | 'oklab' | 'oklch' | 'lch' | 'hsl' | 'hsv',
|
|
32
|
+
default 'oklab') and `hueInterpolation` ('shorter' | 'longer' | 'increasing' |
|
|
33
|
+
'decreasing', default 'shorter'). LinearGradient, SimplexNoise, and MeshGradient
|
|
34
|
+
gain matching props. Foundation fix: hex colors now decode to linear-sRGB (true
|
|
35
|
+
color), and the LCH conversion's green coefficient was corrected. This shifts the
|
|
36
|
+
default appearance of those components (pre-1.0 breaking color change).
|
|
37
|
+
|
|
3
38
|
## 0.5.0
|
|
4
39
|
|
|
5
40
|
### Minor Changes
|
|
@@ -12,7 +47,7 @@
|
|
|
12
47
|
- `time` → `elapsedTime`
|
|
13
48
|
- `Vec2` → `Vector2`
|
|
14
49
|
|
|
15
|
-
`TSLNode`, `voronoi`, `colorRamp`, `quantize`, `displace`, `cursorRipple`, and `
|
|
50
|
+
`TSLNode`, `voronoi`, `colorRamp`, `quantize`, `displace`, `cursorRipple`, and `grain` are unchanged.
|
|
16
51
|
|
|
17
52
|
**Migration:** one-pass find-and-replace in your imports and call sites. No behavioral changes.
|
|
18
53
|
|
|
@@ -38,21 +73,21 @@
|
|
|
38
73
|
|
|
39
74
|
### Minor Changes
|
|
40
75
|
|
|
41
|
-
- 3856367: Add `
|
|
76
|
+
- 3856367: Add `grain` primitive — hash-based, centered film grain for shader compositions.
|
|
42
77
|
|
|
43
78
|
```ts
|
|
44
|
-
import {
|
|
79
|
+
import { grain, time } from "@lovo/matter";
|
|
45
80
|
import { uv } from "three/tsl";
|
|
46
81
|
|
|
47
82
|
// Static grain:
|
|
48
|
-
const
|
|
83
|
+
const grainValue = grain(uv(), 0.08);
|
|
49
84
|
|
|
50
85
|
// Twinkling grain — caller controls the shutter rate. floor() quantizes
|
|
51
86
|
// time to a discrete cadence; the hash is so sensitive that a continuous
|
|
52
87
|
// time input gives no perceptible speed control.
|
|
53
|
-
const
|
|
88
|
+
const grainValue = grain(uv(), 0.08, time.mul(speed).mul(60).floor());
|
|
54
89
|
|
|
55
|
-
material.colorNode = vec4(color.add(
|
|
90
|
+
material.colorNode = vec4(color.add(grainValue), 1);
|
|
56
91
|
```
|
|
57
92
|
|
|
58
93
|
Output is centered around zero (mean of `length(vec2(u, v))` for uniform
|