@ascii-fx/react-three 0.2.0 → 0.3.1
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/README.md +27 -12
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
# @ascii-fx/react-three
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[`@ascii-fx/three`](../three) as React Three Fiber components.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @ascii-fx/react-three three @react-three/fiber
|
|
7
|
+
```
|
|
4
8
|
|
|
5
9
|
```tsx
|
|
6
10
|
import { Canvas } from '@react-three/fiber'
|
|
7
11
|
import * as THREE from 'three/webgpu'
|
|
8
12
|
import { AsciiEffect } from '@ascii-fx/react-three'
|
|
9
13
|
|
|
10
|
-
;<Canvas
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}}
|
|
16
|
-
>
|
|
17
|
-
<mesh>{/* your scene */}</mesh>
|
|
18
|
-
<AsciiEffect profile={profileRef} columns={180} interaction="reveal" />
|
|
14
|
+
;<Canvas gl={(canvas) => new THREE.WebGPURenderer({ canvas })}>
|
|
15
|
+
<mesh>
|
|
16
|
+
<torusKnotGeometry />
|
|
17
|
+
<meshNormalMaterial />
|
|
18
|
+
</mesh>
|
|
19
|
+
<AsciiEffect profile={profile} columns={160} />
|
|
19
20
|
</Canvas>
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
`<AsciiEffect>`
|
|
23
|
+
Drop `<AsciiEffect>` inside a `<Canvas>` and everything rendered before it comes out as ASCII.
|
|
24
|
+
|
|
25
|
+
## Why it's a separate package
|
|
26
|
+
|
|
27
|
+
This is the only entry point in the project that pulls in `three` _and_ `@react-three/fiber`. Folding it into [`@ascii-fx/react`](../react) would put both in the dependency graph of every plain React app that just wanted `<AsciiImage>` — so it lives here, and you install it only if you're already in R3F.
|
|
28
|
+
|
|
29
|
+
## Components
|
|
30
|
+
|
|
31
|
+
- **`<AsciiEffect>`** — post-processes the scene through the exact matcher on the renderer's own device, no readback.
|
|
32
|
+
- **`<AsciiGlyphs>`** — an instanced glyph mesh you can place, light, and move within the scene.
|
|
33
|
+
- **`useAsciiEffect`** — the hook underneath, when you want the pass without the component.
|
|
34
|
+
|
|
35
|
+
Requires an R3F v9 `<Canvas>` running `THREE.WebGPURenderer`; see [`@ascii-fx/three`](../three) for why WebGL isn't supported.
|
|
36
|
+
|
|
37
|
+
## License
|
|
23
38
|
|
|
24
|
-
|
|
39
|
+
[MIT](../../LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ascii-fx/react-three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "React Three Fiber bindings for ASCII FX: <AsciiEffect>, <AsciiGlyphs>, useAsciiEffect (WebGPURenderer only).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ascii",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@ascii-fx/
|
|
43
|
-
"@ascii-fx/
|
|
44
|
-
"@ascii-fx/
|
|
42
|
+
"@ascii-fx/core": "0.3.1",
|
|
43
|
+
"@ascii-fx/three": "0.3.1",
|
|
44
|
+
"@ascii-fx/gpu": "0.3.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@react-three/fiber": "^9.7.0",
|