wgpu-kit 0.9.11 → 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.
Files changed (41) hide show
  1. package/README.md +7 -0
  2. package/dist/core/buffer.d.ts +1 -1
  3. package/dist/core/buffer.js +109 -0
  4. package/dist/core/context.d.ts +2 -0
  5. package/dist/core/context.js +62 -0
  6. package/dist/core/errors.js +42 -0
  7. package/dist/core/kernel.js +197 -0
  8. package/dist/core/layout.d.ts +5 -1
  9. package/dist/core/layout.js +69 -0
  10. package/dist/core/pingpong.js +61 -0
  11. package/dist/core/raw.js +38 -0
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +11 -1510
  14. package/dist/interop/three.js +29 -0
  15. package/dist/media.js +70 -0
  16. package/dist/observe.d.ts +19 -0
  17. package/dist/observe.js +76 -0
  18. package/dist/packs/fields/index.js +230 -0
  19. package/dist/packs/image/index.js +250 -0
  20. package/dist/packs/life/boids.js +367 -0
  21. package/dist/packs/life/index.js +8 -0
  22. package/dist/packs/life/map.js +110 -0
  23. package/dist/packs/life/physarum.js +228 -0
  24. package/dist/packs/life/tentacles.js +238 -0
  25. package/dist/packs/life/turing.js +203 -0
  26. package/dist/packs/particles/config.d.ts +1 -0
  27. package/dist/packs/particles/config.js +36 -0
  28. package/dist/packs/particles/grid.js +248 -0
  29. package/dist/packs/particles/index.js +361 -0
  30. package/dist/packs/particles/presets.js +75 -0
  31. package/dist/packs/particles/render.js +116 -0
  32. package/dist/packs/particles/wgsl.js +175 -0
  33. package/dist/react/index.js +36 -0
  34. package/dist/vite.js +27 -28
  35. package/package.json +1 -1
  36. package/dist/fields.js +0 -585
  37. package/dist/image.js +0 -318
  38. package/dist/life.js +0 -1407
  39. package/dist/particles.js +0 -1245
  40. package/dist/react.js +0 -1289
  41. package/dist/three.js +0 -33
package/dist/three.js DELETED
@@ -1,33 +0,0 @@
1
- // src/interop/three.ts
2
- function threePoints(sim, THREE, opts = {}) {
3
- const { pos } = sim.buffers();
4
- const count = pos.length;
5
- const positions = new Float32Array(count * 3);
6
- const geometry = new THREE.BufferGeometry();
7
- const attr = new THREE.BufferAttribute(positions, 3);
8
- geometry.setAttribute("position", attr);
9
- const material = new THREE.PointsMaterial({
10
- size: opts.size ?? 0.015,
11
- color: opts.color ?? 9417983,
12
- sizeAttenuation: true
13
- });
14
- const points = new THREE.Points(geometry, material);
15
- return {
16
- points,
17
- async update() {
18
- const data = await pos.read();
19
- for (let i = 0; i < count; i++) {
20
- positions[i * 3] = data[i * 2] ?? 0;
21
- positions[i * 3 + 1] = data[i * 2 + 1] ?? 0;
22
- positions[i * 3 + 2] = 0;
23
- }
24
- attr.needsUpdate = true;
25
- },
26
- dispose() {
27
- sim.destroy();
28
- }
29
- };
30
- }
31
- export {
32
- threePoints
33
- };