tres-vfx 0.1.0 → 0.3.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/README.md +68 -13
- package/dist/index.d.ts +669 -1
- package/dist/index.js +1018 -1
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ✨ Three VFX ✨
|
|
2
2
|
|
|
3
|
-
High-performance GPU-accelerated particle system for Three.js WebGPU
|
|
3
|
+
High-performance GPU-accelerated particle system for Three.js WebGPU.
|
|
4
|
+
|
|
5
|
+
Available for React Three Fiber (R3F), and experimentally for vanilla Three.js, TresJS (Vue), and Threlte (Svelte).
|
|
4
6
|
|
|
5
7
|
## Features
|
|
6
8
|
|
|
@@ -11,25 +13,21 @@ High-performance GPU-accelerated particle system for Three.js WebGPU with React
|
|
|
11
13
|
- 📊 **Curve-based Control** - Bezier curves for size, opacity, velocity, and rotation over lifetime
|
|
12
14
|
- 🔗 **Emitter System** - Decoupled emitters that can share particle systems
|
|
13
15
|
- ⚡ **WebGPU Native** - Built specifically for Three.js WebGPU renderer
|
|
16
|
+
- 🐢 **WebGL fallback** – Three VFX targets WebGPU ([79% global support](https://caniuse.com/webgpu)) but provides a CPU fallback
|
|
14
17
|
|
|
15
|
-
##
|
|
18
|
+
## Quick Start
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
npm install r3f-vfx
|
|
19
|
-
```
|
|
20
|
+
### React Three Fiber
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
Add it to your React Three Fiber project with:
|
|
22
23
|
|
|
23
24
|
```bash
|
|
24
|
-
npm install
|
|
25
|
+
npm install r3f-vfx
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
## Quick Start
|
|
28
|
-
|
|
29
28
|
```tsx
|
|
30
29
|
import { Canvas } from '@react-three/fiber'
|
|
31
|
-
import { VFXParticles
|
|
32
|
-
import * as THREE from 'three/webgpu'
|
|
30
|
+
import { VFXParticles } from 'r3f-vfx'
|
|
33
31
|
|
|
34
32
|
function App() {
|
|
35
33
|
return (
|
|
@@ -40,7 +38,64 @@ function App() {
|
|
|
40
38
|
}
|
|
41
39
|
```
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
### Vanilla Three.js (Experimental)
|
|
42
|
+
|
|
43
|
+
Add it to your vanilla Three.js project with:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm install vanilla-vfx
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { VFXParticles } from 'vanilla-vfx'
|
|
51
|
+
|
|
52
|
+
const particles = new VFXParticles(renderer, { debug: true })
|
|
53
|
+
scene.add(particles.renderObject)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### TresJS / Vue (Experimental)
|
|
57
|
+
|
|
58
|
+
Add it to your TresJS project with:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install tres-vfx
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<script setup>
|
|
66
|
+
import { TresCanvas } from '@tresjs/core'
|
|
67
|
+
import { VFXParticles } from 'tres-vfx'
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<TresCanvas>
|
|
72
|
+
<VFXParticles debug />
|
|
73
|
+
</TresCanvas>
|
|
74
|
+
</template>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Threlte / Svelte (Experimental)
|
|
78
|
+
|
|
79
|
+
Add it to your Threlte project with:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npm install threlte-vfx
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```svelte
|
|
86
|
+
<script>
|
|
87
|
+
import { Canvas } from '@threlte/core'
|
|
88
|
+
import VFXParticles from 'threlte-vfx/VFXParticles.svelte'
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<Canvas>
|
|
92
|
+
<VFXParticles debug />
|
|
93
|
+
</Canvas>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## How to use
|
|
97
|
+
|
|
98
|
+
Use the debug panel to design your effect, then copy the generated code and replace it in your code.
|
|
44
99
|
|
|
45
100
|
## API Reference
|
|
46
101
|
|