@lovo/matter 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hunter Garrett / Lovo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # @lovo/matter
2
+
3
+ Framework-agnostic engine for **Matter** — React shader components on WebGPU + Three.js TSL.
4
+
5
+ This package contains the TSL primitives, the renderer, and the scheduler. It has no React dependency. If you're using React, install [`@lovo/matter-react`](https://www.npmjs.com/package/@lovo/matter-react) alongside this package — it adds React-friendly wrappers (a shared `<MatterScene>`, input hooks, and `@react-three/fiber` integration) on top of this engine.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @lovo/matter three
11
+ # or: pnpm add @lovo/matter three
12
+ ```
13
+
14
+ `three` is a peer dependency. Matter targets `three@^0.170.0` and uses the WebGPU TSL API exclusively.
15
+
16
+ ## What's inside
17
+
18
+ - **TSL primitives**: `fbm`, `voronoi`, `colorRamp`, `quantize`, and a handful of others — composable shader fragments for procedural visuals.
19
+ - **Renderer**: thin wrapper around `WebGPURenderer` that handles canvas resize, DPR, and `setClearColor`.
20
+ - **Scheduler**: visibility/intersection-aware render loop that pauses when the canvas is off-screen or the tab is hidden.
21
+
22
+ ## Minimal usage
23
+
24
+ ```typescript
25
+ import { fbm, colorRamp } from '@lovo/matter'
26
+ import { uv, vec3, time } from 'three/tsl'
27
+
28
+ // Inside your TSL fragment graph:
29
+ const noise = fbm(uv().mul(4).add(time.mul(0.1)))
30
+ const color = colorRamp(noise, [
31
+ { stop: 0.0, color: vec3(0.05, 0.05, 0.10) },
32
+ { stop: 1.0, color: vec3(0.30, 0.50, 0.95) },
33
+ ])
34
+ ```
35
+
36
+ For polished drop-in components like `<LinearGradient>` and `<Aurora>`, install [`@lovo/matter-cli`](https://www.npmjs.com/package/@lovo/matter-cli) and copy them into your project.
37
+
38
+ ## Docs
39
+
40
+ Full docs and live demos: <https://github.com/lovo-hq/matter>
41
+
42
+ ## License
43
+
44
+ MIT — see [LICENSE](./LICENSE).