@react-three/fiber 10.0.0-alpha.5 → 10.0.0-alpha.6

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 (39) hide show
  1. package/dist/chunks/webgpu.cjs +37 -0
  2. package/dist/chunks/webgpu.mjs +21 -0
  3. package/dist/extension.cjs +13 -0
  4. package/dist/extension.d.cts +63 -0
  5. package/dist/extension.d.mts +63 -0
  6. package/dist/extension.d.ts +63 -0
  7. package/dist/extension.mjs +1 -0
  8. package/dist/index.cjs +98 -15369
  9. package/dist/index.d.cts +101 -3885
  10. package/dist/index.d.mts +101 -3885
  11. package/dist/index.d.ts +101 -3857
  12. package/dist/index.mjs +12 -15270
  13. package/dist/legacy.cjs +105 -15307
  14. package/dist/legacy.d.cts +115 -3874
  15. package/dist/legacy.d.mts +115 -3874
  16. package/dist/legacy.d.ts +116 -3849
  17. package/dist/legacy.mjs +21 -15224
  18. package/dist/shared/fiber.34TOMPo3.d.cts +2494 -0
  19. package/dist/shared/fiber.BFuGd7gN.d.cts +90 -0
  20. package/dist/shared/fiber.BO8-26r8.cjs +541 -0
  21. package/dist/shared/fiber.BSXtODQl.cjs +14 -0
  22. package/dist/shared/fiber.Bll9fqKA.d.mts +90 -0
  23. package/dist/shared/fiber.BuWl08aJ.mjs +16564 -0
  24. package/dist/shared/fiber.C-3TIsF8.mjs +500 -0
  25. package/dist/shared/fiber.CjMAAsJy.d.ts +2494 -0
  26. package/dist/shared/fiber.DEWBFQJe.mjs +9 -0
  27. package/dist/shared/fiber.DQTSZ24m.d.cts +1240 -0
  28. package/dist/shared/fiber.DQTSZ24m.d.mts +1240 -0
  29. package/dist/shared/fiber.DQTSZ24m.d.ts +1240 -0
  30. package/dist/shared/fiber.DuA4F8L5.d.ts +90 -0
  31. package/dist/shared/fiber.Dy7Uz273.d.mts +2494 -0
  32. package/dist/shared/fiber.TRm3lZ7I.cjs +16662 -0
  33. package/dist/webgpu/index.cjs +101 -16209
  34. package/dist/webgpu/index.d.cts +106 -4247
  35. package/dist/webgpu/index.d.mts +106 -4247
  36. package/dist/webgpu/index.d.ts +106 -4219
  37. package/dist/webgpu/index.mjs +15 -16092
  38. package/package.json +13 -10
  39. package/readme.md +11 -2
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ const THREE = require('three/webgpu');
4
+ const tsl = require('three/tsl');
5
+
6
+ function _interopNamespaceCompat(e) {
7
+ if (e && typeof e === 'object' && 'default' in e) return e;
8
+ const n = Object.create(null);
9
+ if (e) {
10
+ for (const k in e) {
11
+ n[k] = e[k];
12
+ }
13
+ }
14
+ n.default = e;
15
+ return n;
16
+ }
17
+
18
+ const THREE__namespace = /*#__PURE__*/_interopNamespaceCompat(THREE);
19
+
20
+ const webgpuSupport = {
21
+ kind: "webgpu",
22
+ three: THREE__namespace,
23
+ Renderer: THREE__namespace.WebGPURenderer,
24
+ RenderTarget: THREE__namespace.RenderTarget,
25
+ CubeRenderTarget: THREE__namespace.CubeRenderTarget,
26
+ CanvasTarget: THREE__namespace.CanvasTarget,
27
+ // What the occlusion observer (core/visibility.ts) is built from
28
+ occlusion: {
29
+ Node: THREE__namespace.Node,
30
+ NodeUpdateType: THREE__namespace.NodeUpdateType,
31
+ MeshBasicNodeMaterial: THREE__namespace.MeshBasicNodeMaterial,
32
+ uniform: tsl.uniform,
33
+ nodeObject: tsl.nodeObject
34
+ }
35
+ };
36
+
37
+ exports.webgpuSupport = webgpuSupport;
@@ -0,0 +1,21 @@
1
+ import * as THREE from 'three/webgpu';
2
+ import { nodeObject, uniform } from 'three/tsl';
3
+
4
+ const webgpuSupport = {
5
+ kind: "webgpu",
6
+ three: THREE,
7
+ Renderer: THREE.WebGPURenderer,
8
+ RenderTarget: THREE.RenderTarget,
9
+ CubeRenderTarget: THREE.CubeRenderTarget,
10
+ CanvasTarget: THREE.CanvasTarget,
11
+ // What the occlusion observer (core/visibility.ts) is built from
12
+ occlusion: {
13
+ Node: THREE.Node,
14
+ NodeUpdateType: THREE.NodeUpdateType,
15
+ MeshBasicNodeMaterial: THREE.MeshBasicNodeMaterial,
16
+ uniform,
17
+ nodeObject
18
+ }
19
+ };
20
+
21
+ export { webgpuSupport };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ const textureStaging = require('./shared/fiber.BO8-26r8.cjs');
4
+
5
+
6
+
7
+ exports.context = textureStaging.context;
8
+ exports.getTextureView = textureStaging.getTextureView;
9
+ exports.registerRootExtension = textureStaging.registerRootExtension;
10
+ exports.setRenderOverride = textureStaging.setRenderOverride;
11
+ exports.useFrame = textureStaging.useFrame;
12
+ exports.useStore = textureStaging.useStore;
13
+ exports.useThree = textureStaging.useThree;
@@ -0,0 +1,63 @@
1
+ import { aN as FrameNextCallback, J as RootStore } from './shared/fiber.DQTSZ24m.cjs';
2
+ export { aE as Act, aF as Bridge, U as Camera, a1 as ComputeFunction, aK as Disposable, Z as DomEvent, D as Dpr, aJ as EquConfig, $ as EventHandlers, a3 as EventManager, _ as Events, a0 as FilterFunction, aO as FrameCallback, aL as FrameNextState, aM as FrameState, F as Frameloop, I as InternalState, K as Intersection, W as IntersectionEvent, aC as IsAllOptional, aB as IsOptional, aA as Mutable, ax as NonFunctionKeys, aI as ObjectMap, ay as Overwrite, B as Performance, a4 as PointerCaptureTarget, P as PointerState, az as Properties, x as R3FRenderer, A as RenderCallback, v as RootExtension, H as RootState, aG as SetBlock, y as Size, S as Subscription, aD as ThreeCamera, Y as ThreeEvent, aH as UnblockProps, z as Viewport, a5 as VisibilityEntry, X as XRManager, a2 as XRPointerConfig, w as context, t as registerRootExtension, u as setRenderOverride, a$ as useStore, b0 as useThree } from './shared/fiber.DQTSZ24m.cjs';
3
+ import { UseFrameNextOptions, FrameNextControls } from '@pmndrs/scheduler';
4
+ export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, SchedulerApi, UseFrameNextOptions, UseFrameOptions } from '@pmndrs/scheduler';
5
+ import { Texture } from 'three';
6
+ import 'three/webgpu';
7
+ import 'react';
8
+ import 'zustand';
9
+ import 'zustand/traditional';
10
+ import 'three/tsl';
11
+
12
+ /**
13
+ * Frame hook with phase-based ordering, priority, and FPS throttling.
14
+ *
15
+ * Always delivers full RootState — works both inside and outside Canvas context:
16
+ * - Inside Canvas: Full RootState (renderer, scene, camera, etc.)
17
+ * - Outside Canvas: The job registers immediately but the callback is held until a
18
+ * Canvas adopts it, then runs with full RootState. For hostless / standalone
19
+ * frame loops with no Canvas, use `@pmndrs/scheduler` directly.
20
+ *
21
+ * Returns a controls object for manual stepping, pausing, and resuming.
22
+ *
23
+ * @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
24
+ * @param priorityOrOptions - Either a priority number (backwards compat) or options object
25
+ * @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
26
+ *
27
+ * @example
28
+ * // Simple priority (backwards compat)
29
+ * useFrame((state, delta) => { ... }, 5)
30
+ *
31
+ * @example
32
+ * // With phase-based ordering
33
+ * useFrame((state, delta) => { ... }, { phase: 'physics' })
34
+ *
35
+ * @example
36
+ * // Outside Canvas - callback waits for a Canvas, then always has full state
37
+ * function UI() {
38
+ * useFrame((state, delta) => { syncUI(state.camera) });
39
+ * return <button>...</button>;
40
+ * }
41
+ *
42
+ * @example
43
+ * // Hostless / standalone loop (no Canvas) - use @pmndrs/scheduler directly
44
+ * import { getScheduler } from '@pmndrs/scheduler'
45
+ * getScheduler().register((state, delta) => { updateGame(delta) })
46
+ *
47
+ * @example
48
+ * // Scheduler-only access (no callback)
49
+ * const { scheduler } = useFrame()
50
+ * scheduler.pauseJob('some-job-id')
51
+ *
52
+ * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useframe
53
+ */
54
+ declare function useFrame(callback?: FrameNextCallback, priorityOrOptions?: number | UseFrameNextOptions): FrameNextControls;
55
+
56
+ /**
57
+ * The texture registry as a reader during render should see it: registered textures, plus those a
58
+ * `useTexture` earlier in this render loaded but has not registered yet. Returns the registry Map
59
+ * itself when nothing is staged. Read-only: register through `useTexture` / `useTextures().add`.
60
+ */
61
+ declare function getTextureView(store: RootStore): ReadonlyMap<string, Texture>;
62
+
63
+ export { FrameNextCallback, RootStore, getTextureView, useFrame };
@@ -0,0 +1,63 @@
1
+ import { aN as FrameNextCallback, J as RootStore } from './shared/fiber.DQTSZ24m.mjs';
2
+ export { aE as Act, aF as Bridge, U as Camera, a1 as ComputeFunction, aK as Disposable, Z as DomEvent, D as Dpr, aJ as EquConfig, $ as EventHandlers, a3 as EventManager, _ as Events, a0 as FilterFunction, aO as FrameCallback, aL as FrameNextState, aM as FrameState, F as Frameloop, I as InternalState, K as Intersection, W as IntersectionEvent, aC as IsAllOptional, aB as IsOptional, aA as Mutable, ax as NonFunctionKeys, aI as ObjectMap, ay as Overwrite, B as Performance, a4 as PointerCaptureTarget, P as PointerState, az as Properties, x as R3FRenderer, A as RenderCallback, v as RootExtension, H as RootState, aG as SetBlock, y as Size, S as Subscription, aD as ThreeCamera, Y as ThreeEvent, aH as UnblockProps, z as Viewport, a5 as VisibilityEntry, X as XRManager, a2 as XRPointerConfig, w as context, t as registerRootExtension, u as setRenderOverride, a$ as useStore, b0 as useThree } from './shared/fiber.DQTSZ24m.mjs';
3
+ import { UseFrameNextOptions, FrameNextControls } from '@pmndrs/scheduler';
4
+ export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, SchedulerApi, UseFrameNextOptions, UseFrameOptions } from '@pmndrs/scheduler';
5
+ import { Texture } from 'three';
6
+ import 'three/webgpu';
7
+ import 'react';
8
+ import 'zustand';
9
+ import 'zustand/traditional';
10
+ import 'three/tsl';
11
+
12
+ /**
13
+ * Frame hook with phase-based ordering, priority, and FPS throttling.
14
+ *
15
+ * Always delivers full RootState — works both inside and outside Canvas context:
16
+ * - Inside Canvas: Full RootState (renderer, scene, camera, etc.)
17
+ * - Outside Canvas: The job registers immediately but the callback is held until a
18
+ * Canvas adopts it, then runs with full RootState. For hostless / standalone
19
+ * frame loops with no Canvas, use `@pmndrs/scheduler` directly.
20
+ *
21
+ * Returns a controls object for manual stepping, pausing, and resuming.
22
+ *
23
+ * @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
24
+ * @param priorityOrOptions - Either a priority number (backwards compat) or options object
25
+ * @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
26
+ *
27
+ * @example
28
+ * // Simple priority (backwards compat)
29
+ * useFrame((state, delta) => { ... }, 5)
30
+ *
31
+ * @example
32
+ * // With phase-based ordering
33
+ * useFrame((state, delta) => { ... }, { phase: 'physics' })
34
+ *
35
+ * @example
36
+ * // Outside Canvas - callback waits for a Canvas, then always has full state
37
+ * function UI() {
38
+ * useFrame((state, delta) => { syncUI(state.camera) });
39
+ * return <button>...</button>;
40
+ * }
41
+ *
42
+ * @example
43
+ * // Hostless / standalone loop (no Canvas) - use @pmndrs/scheduler directly
44
+ * import { getScheduler } from '@pmndrs/scheduler'
45
+ * getScheduler().register((state, delta) => { updateGame(delta) })
46
+ *
47
+ * @example
48
+ * // Scheduler-only access (no callback)
49
+ * const { scheduler } = useFrame()
50
+ * scheduler.pauseJob('some-job-id')
51
+ *
52
+ * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useframe
53
+ */
54
+ declare function useFrame(callback?: FrameNextCallback, priorityOrOptions?: number | UseFrameNextOptions): FrameNextControls;
55
+
56
+ /**
57
+ * The texture registry as a reader during render should see it: registered textures, plus those a
58
+ * `useTexture` earlier in this render loaded but has not registered yet. Returns the registry Map
59
+ * itself when nothing is staged. Read-only: register through `useTexture` / `useTextures().add`.
60
+ */
61
+ declare function getTextureView(store: RootStore): ReadonlyMap<string, Texture>;
62
+
63
+ export { FrameNextCallback, RootStore, getTextureView, useFrame };
@@ -0,0 +1,63 @@
1
+ import { aN as FrameNextCallback, J as RootStore } from './shared/fiber.DQTSZ24m.js';
2
+ export { aE as Act, aF as Bridge, U as Camera, a1 as ComputeFunction, aK as Disposable, Z as DomEvent, D as Dpr, aJ as EquConfig, $ as EventHandlers, a3 as EventManager, _ as Events, a0 as FilterFunction, aO as FrameCallback, aL as FrameNextState, aM as FrameState, F as Frameloop, I as InternalState, K as Intersection, W as IntersectionEvent, aC as IsAllOptional, aB as IsOptional, aA as Mutable, ax as NonFunctionKeys, aI as ObjectMap, ay as Overwrite, B as Performance, a4 as PointerCaptureTarget, P as PointerState, az as Properties, x as R3FRenderer, A as RenderCallback, v as RootExtension, H as RootState, aG as SetBlock, y as Size, S as Subscription, aD as ThreeCamera, Y as ThreeEvent, aH as UnblockProps, z as Viewport, a5 as VisibilityEntry, X as XRManager, a2 as XRPointerConfig, w as context, t as registerRootExtension, u as setRenderOverride, a$ as useStore, b0 as useThree } from './shared/fiber.DQTSZ24m.js';
3
+ import { UseFrameNextOptions, FrameNextControls } from '@pmndrs/scheduler';
4
+ export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, SchedulerApi, UseFrameNextOptions, UseFrameOptions } from '@pmndrs/scheduler';
5
+ import { Texture } from 'three';
6
+ import 'three/webgpu';
7
+ import 'react';
8
+ import 'zustand';
9
+ import 'zustand/traditional';
10
+ import 'three/tsl';
11
+
12
+ /**
13
+ * Frame hook with phase-based ordering, priority, and FPS throttling.
14
+ *
15
+ * Always delivers full RootState — works both inside and outside Canvas context:
16
+ * - Inside Canvas: Full RootState (renderer, scene, camera, etc.)
17
+ * - Outside Canvas: The job registers immediately but the callback is held until a
18
+ * Canvas adopts it, then runs with full RootState. For hostless / standalone
19
+ * frame loops with no Canvas, use `@pmndrs/scheduler` directly.
20
+ *
21
+ * Returns a controls object for manual stepping, pausing, and resuming.
22
+ *
23
+ * @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
24
+ * @param priorityOrOptions - Either a priority number (backwards compat) or options object
25
+ * @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
26
+ *
27
+ * @example
28
+ * // Simple priority (backwards compat)
29
+ * useFrame((state, delta) => { ... }, 5)
30
+ *
31
+ * @example
32
+ * // With phase-based ordering
33
+ * useFrame((state, delta) => { ... }, { phase: 'physics' })
34
+ *
35
+ * @example
36
+ * // Outside Canvas - callback waits for a Canvas, then always has full state
37
+ * function UI() {
38
+ * useFrame((state, delta) => { syncUI(state.camera) });
39
+ * return <button>...</button>;
40
+ * }
41
+ *
42
+ * @example
43
+ * // Hostless / standalone loop (no Canvas) - use @pmndrs/scheduler directly
44
+ * import { getScheduler } from '@pmndrs/scheduler'
45
+ * getScheduler().register((state, delta) => { updateGame(delta) })
46
+ *
47
+ * @example
48
+ * // Scheduler-only access (no callback)
49
+ * const { scheduler } = useFrame()
50
+ * scheduler.pauseJob('some-job-id')
51
+ *
52
+ * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useframe
53
+ */
54
+ declare function useFrame(callback?: FrameNextCallback, priorityOrOptions?: number | UseFrameNextOptions): FrameNextControls;
55
+
56
+ /**
57
+ * The texture registry as a reader during render should see it: registered textures, plus those a
58
+ * `useTexture` earlier in this render loaded but has not registered yet. Returns the registry Map
59
+ * itself when nothing is staged. Read-only: register through `useTexture` / `useTextures().add`.
60
+ */
61
+ declare function getTextureView(store: RootStore): ReadonlyMap<string, Texture>;
62
+
63
+ export { FrameNextCallback, RootStore, getTextureView, useFrame };
@@ -0,0 +1 @@
1
+ export { c as context, g as getTextureView, r as registerRootExtension, s as setRenderOverride, b as useFrame, u as useStore, a as useThree } from './shared/fiber.C-3TIsF8.mjs';