@react-three/fiber 10.0.0-canary.e3891fb → 10.0.0-canary.e78793c
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/dist/extension.cjs +8 -8
- package/dist/extension.d.cts +50 -6
- package/dist/extension.d.mts +50 -6
- package/dist/extension.d.ts +50 -6
- package/dist/extension.mjs +1 -1
- package/dist/index.cjs +17 -19
- package/dist/index.d.cts +16 -49
- package/dist/index.d.mts +16 -49
- package/dist/index.d.ts +16 -49
- package/dist/index.mjs +7 -8
- package/dist/legacy.cjs +37 -15
- package/dist/legacy.d.cts +10 -8
- package/dist/legacy.d.mts +10 -8
- package/dist/legacy.d.ts +10 -8
- package/dist/legacy.mjs +13 -5
- package/dist/shared/{fiber.C4GU39Za.d.ts → fiber.34TOMPo3.d.cts} +190 -471
- package/dist/shared/fiber.BFuGd7gN.d.cts +90 -0
- package/dist/shared/fiber.BSYBnw8x.mjs +16563 -0
- package/dist/shared/{fiber.B0oukOFO.mjs → fiber.Biz9olEe.mjs} +181 -64
- package/dist/shared/fiber.Bll9fqKA.d.mts +90 -0
- package/dist/shared/{fiber.Cg2YRc54.d.cts → fiber.CjMAAsJy.d.ts} +190 -471
- package/dist/shared/{fiber.I5Q4dVvl.d.cts → fiber.DQTSZ24m.d.cts} +488 -26
- package/dist/shared/{fiber.I5Q4dVvl.d.mts → fiber.DQTSZ24m.d.mts} +488 -26
- package/dist/shared/{fiber.I5Q4dVvl.d.ts → fiber.DQTSZ24m.d.ts} +488 -26
- package/dist/shared/fiber.DUgKvaq-.mjs +9 -0
- package/dist/shared/{fiber.khFlPHPf.cjs → fiber.DfiCufha.cjs} +186 -62
- package/dist/shared/fiber.DuA4F8L5.d.ts +90 -0
- package/dist/shared/{fiber.2dyldILT.d.mts → fiber.Dy7Uz273.d.mts} +190 -471
- package/dist/shared/fiber.X4yI0DId.cjs +14 -0
- package/dist/shared/fiber.nDnBf1np.cjs +16661 -0
- package/dist/webgpu/index.cjs +16 -18
- package/dist/webgpu/index.d.cts +17 -79
- package/dist/webgpu/index.d.mts +17 -79
- package/dist/webgpu/index.d.ts +17 -79
- package/dist/webgpu/index.mjs +7 -9
- package/package.json +8 -8
- package/readme.md +1 -1
- package/dist/chunks/webgl.cjs +0 -27
- package/dist/chunks/webgl.mjs +0 -11
- package/dist/shared/fiber.BU0vBHc9.d.mts +0 -48
- package/dist/shared/fiber.Cx-UAmMb.d.ts +0 -48
- package/dist/shared/fiber.DAl4H27x.d.cts +0 -48
- package/dist/shared/fiber.L0cJPxh2.cjs +0 -15151
- package/dist/shared/fiber.UW5CRgts.mjs +0 -15053
package/dist/webgpu/index.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
const Canvas$1 = require('../shared/fiber.
|
|
4
|
+
const Canvas$1 = require('../shared/fiber.nDnBf1np.cjs');
|
|
5
5
|
const webgpu = require('../chunks/webgpu.cjs');
|
|
6
|
-
const
|
|
6
|
+
const narrowed = require('../shared/fiber.X4yI0DId.cjs');
|
|
7
|
+
const textureStaging = require('../shared/fiber.DfiCufha.cjs');
|
|
7
8
|
const scheduler = require('@pmndrs/scheduler');
|
|
8
9
|
|
|
9
10
|
function addTexture(set, key, value) {
|
|
@@ -54,10 +55,7 @@ const provider = {
|
|
|
54
55
|
function createRoot(canvas) {
|
|
55
56
|
return Canvas$1.createRoot(canvas, provider);
|
|
56
57
|
}
|
|
57
|
-
const
|
|
58
|
-
const useFrame = extensions.useFrame;
|
|
59
|
-
const useRenderTarget = Canvas$1.useRenderTarget;
|
|
60
|
-
const Canvas = ((props) => /* @__PURE__ */ jsxRuntime.jsx(Canvas$1.Canvas, { ...props, provider }));
|
|
58
|
+
const Canvas = narrowed.asWebGPUCanvas((props) => /* @__PURE__ */ jsxRuntime.jsx(Canvas$1.Canvas, { ...props, provider }));
|
|
61
59
|
|
|
62
60
|
exports.Environment = Canvas$1.Environment;
|
|
63
61
|
exports.EnvironmentCube = Canvas$1.EnvironmentCube;
|
|
@@ -135,15 +133,18 @@ exports.useTexture = Canvas$1.useTexture;
|
|
|
135
133
|
exports.useTextures = Canvas$1.useTextures;
|
|
136
134
|
exports.waitForPrimary = Canvas$1.waitForPrimary;
|
|
137
135
|
exports.whenThree = Canvas$1.whenThree;
|
|
138
|
-
exports.
|
|
139
|
-
exports.
|
|
140
|
-
exports.
|
|
141
|
-
exports.
|
|
142
|
-
exports.
|
|
143
|
-
exports.
|
|
144
|
-
exports.
|
|
145
|
-
exports.
|
|
146
|
-
exports.
|
|
136
|
+
exports.useFrame = narrowed.useFrame;
|
|
137
|
+
exports.useRenderTarget = narrowed.useRenderTarget;
|
|
138
|
+
exports.useThree = narrowed.useThree;
|
|
139
|
+
exports.Block = textureStaging.Block;
|
|
140
|
+
exports.ErrorBoundary = textureStaging.ErrorBoundary;
|
|
141
|
+
exports.context = textureStaging.context;
|
|
142
|
+
exports.registerRootExtension = textureStaging.registerRootExtension;
|
|
143
|
+
exports.setRenderOverride = textureStaging.setRenderOverride;
|
|
144
|
+
exports.useBridge = textureStaging.useBridge;
|
|
145
|
+
exports.useIsomorphicLayoutEffect = textureStaging.useIsomorphicLayoutEffect;
|
|
146
|
+
exports.useMutableCallback = textureStaging.useMutableCallback;
|
|
147
|
+
exports.useStore = textureStaging.useStore;
|
|
147
148
|
exports.Scheduler = scheduler.Scheduler;
|
|
148
149
|
exports.getScheduler = scheduler.getScheduler;
|
|
149
150
|
exports.Canvas = Canvas;
|
|
@@ -151,6 +152,3 @@ exports.R3F_BUILD_LEGACY = R3F_BUILD_LEGACY;
|
|
|
151
152
|
exports.R3F_BUILD_WEBGPU = R3F_BUILD_WEBGPU;
|
|
152
153
|
exports.createRoot = createRoot;
|
|
153
154
|
exports.createTextureOperations = createTextureOperations;
|
|
154
|
-
exports.useFrame = useFrame;
|
|
155
|
-
exports.useRenderTarget = useRenderTarget;
|
|
156
|
-
exports.useThree = useThree;
|
package/dist/webgpu/index.d.cts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import * as ThreeWebGPU from 'three/webgpu';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export {
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as _react_three_fiber from '@react-three/fiber';
|
|
4
|
+
import { M as MutableOrReadonlyParameters$1, a as MathRepresentation$1, V as VectorRepresentation$1, b as MathTypes$1, c as MathType$1, d as MathProps$1, e as Vector2$1, f as Vector3$1, g as Vector4$1, C as Color$1, L as Layers$1, Q as Quaternion$1, E as Euler$1, h as Matrix3$1, i as Matrix4$1, R as RaycastableRepresentation$1, j as EventProps$1, G as GeometryTransformProps$1, k as GeometryProps$1, T as TSLNodeInput$1, N as NodeProps$1, l as ReactProps$1, m as ConstructorRepresentation, n as ElementProps$1, o as ThreeElement$1, p as ThreeToJSXElements$1, O as Object3DMethod$1, q as ThreeElementsOf$1, r as ElementOf$1, H as RootState, s as ReconcilerRoot } from '../shared/fiber.DQTSZ24m.cjs';
|
|
5
|
+
export { aE as Act, as as Args, at as ArgsProp, ap as AttachFnType, aq as AttachType, a7 as BaseRendererProps, aF as Bridge, U as Camera, aj as CameraProps, ag as CanvasSchedulerConfig, ar as Catalogue, aa as ColorManagementConfig, a1 as ComputeFunction, ad as DefaultGLProps, af as DefaultRendererProps, aK as Disposable, Z as DomEvent, D as Dpr, aJ as EquConfig, $ as EventHandlers, a3 as EventManager, _ as Events, am as FiberRoot, a0 as FilterFunction, aY as ForRegisteredRenderer, aO as FrameCallback, aN as FrameNextCallback, aL as FrameNextState, aM as FrameState, F as Frameloop, ae as GLProps, aw as HostConfig, al as InjectState, av as Instance, au as InstanceProps, K as Intersection, W as IntersectionEvent, aC as IsAllOptional, aB as IsOptional, aA as Mutable, ax as NonFunctionKeys, aI as ObjectMap, aR as OcclusionSupport, a6 as OffscreenCanvas, ay as Overwrite, B as Performance, a4 as PointerCaptureTarget, P as PointerState, az as Properties, aZ as R3FRenderTarget, a_ as R3FRendererSupport, aW as Register, aX as RegisteredRenderer, A as RenderCallback, ak as RenderProps, a9 as Renderer, ah as RendererConfigExtended, a8 as RendererFactory, ai as RendererProps, aV as RendererProvider, ac as RendererSettingsConfig, aU as RendererSupport, ao as Root, v as RootExtension, J as RootStore, aG as SetBlock, ab as ShadowsConfig, y as Size, S as Subscription, aD as ThreeCamera, aQ as ThreeCore, Y as ThreeEvent, aP as ThreeNamespace, an as TrackedPromise, aH as UnblockProps, z as Viewport, a5 as VisibilityEntry, aS as WebGLSupport, aT as WebGPUSupport, X as XRManager, a2 as XRPointerConfig, w as context, t as registerRootExtension, u as setRenderOverride, a$ as useStore } from '../shared/fiber.DQTSZ24m.cjs';
|
|
6
|
+
export { B as BackgroundConfig, p as BackgroundProp, ah as Block, a2 as DisposeOptions, K as Environment, H as EnvironmentCube, a5 as EnvironmentLoaderProps, F as EnvironmentMap, J as EnvironmentPortal, D as EnvironmentProps, ai as ErrorBoundary, E as Extensions, aM as FROM_REF, aN as FromRefMarker, q as GLTFLike, o as GlobalEffectType, G as GlobalRenderCallback, t as InferLoadResult, I as InputLike, X as IsObject, A as LegacyInternalState, z as LegacyRenderer, C as LegacyRootState, s as LoaderInstance, L as LoaderLike, v as LoaderResult, Y as MappedTextureType, aQ as ONCE, aS as OnceValue, ad as Portal, N as PresetsType, P as PrimaryCanvasEntry, an as REACT_INTERNAL_PROPS, av as RESERVED_PROPS, R as RenderTargetOptions, $ as Texture, a0 as TextureInput, a1 as TextureResult, Z as UseTextureOptions, a3 as UseTexturesReturn, W as WebGLDefaultProps, x as WebGLProps, y as WebGLShadowConfig, aa as _roots, b as addAfterEffect, a as addEffect, d as addTail, e as advance, aA as applyProps, ax as attach, aq as buildGraph, aj as calculateDpr, S as createEvents, c as createPointerEvents, ac as createPortal, k as createStore, ay as detach, az as diffProps, ar as dispose, c as events, a7 as extend, ao as findInitialRoot, a9 as flushSync, aO as fromRef, as as getInstanceProps, g as getPrimary, j as getPrimaryIds, ap as getRootState, l as getThree, ak as getUuidPrefix, aL as hasConstructor, h as hasPrimary, m as hasThree, i as invalidate, au as invalidateInstance, aB as is, aE as isColorRepresentation, aK as isCopyable, aP as isFromRef, aH as isLayers, aF as isObject3D, aT as isOnce, aC as isOrthographicCamera, aD as isRef, f as isRenderer, aG as isTexture, aI as isUniform, aJ as isVectorLike, aR as once, at as prepare, M as presetsObj, a8 as reconciler, r as registerPrimary, Q as removeInteractivity, aw as resolve, O as swapInteractivity, ab as unmountComponentAtNode, u as unregisterPrimary, al as updateCamera, am as updateFrustum, ag as useBridge, a6 as useEnvironment, U as useGraph, T as useInstanceHandle, ae as useIsomorphicLayoutEffect, V as useLoader, af as useMutableCallback, _ as useTexture, a4 as useTextures, w as waitForPrimary, n as whenThree } from '../shared/fiber.34TOMPo3.cjs';
|
|
7
7
|
import { Texture } from 'three';
|
|
8
8
|
import { StoreApi } from 'zustand';
|
|
9
|
-
|
|
9
|
+
export { W as CanvasProps, e as InternalState, f as R3FRenderer, d as RootState, c as UseFrameWebGPU, U as UseThreeWebGPU, W as WebGPUCanvasProps, h as WebGPUDefaultProps, g as WebGPUProps, i as WebGPUShadowConfig, a as useFrame, b as useRenderTarget, u as useThree } from '../shared/fiber.BFuGd7gN.cjs';
|
|
10
10
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
11
|
-
import { JSX } from 'react';
|
|
12
|
-
import 'react-use-measure';
|
|
13
|
-
import 'react/jsx-runtime';
|
|
14
11
|
import 'zustand/traditional';
|
|
15
12
|
import 'three/tsl';
|
|
13
|
+
import 'react-use-measure';
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
16
|
* The `ReactThreeFiber` namespace of the WebGPU entry: the shared element types plus this entry's JSX map.
|
|
@@ -110,83 +108,23 @@ interface TextureOperations {
|
|
|
110
108
|
}
|
|
111
109
|
declare function createTextureOperations(set: StoreApi<RootState>['setState']): TextureOperations;
|
|
112
110
|
|
|
113
|
-
//* Renderer Props ========================================
|
|
114
|
-
|
|
115
|
-
type WebGPUDefaultProps = Omit<WebGPURendererParameters, 'canvas'> & BaseRendererProps
|
|
116
|
-
|
|
117
|
-
type WebGPUProps =
|
|
118
|
-
| RendererFactory<WebGPURenderer, WebGPUDefaultProps>
|
|
119
|
-
| Partial<Properties<WebGPURenderer> | WebGPURendererParameters>
|
|
120
|
-
|
|
121
|
-
// WebGPU doesn't have shadow maps in the same way
|
|
122
|
-
interface WebGPUShadowConfig {
|
|
123
|
-
shadows?: boolean // Simplified for WebGPU
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
//* WebGPU-specific Types ========================================
|
|
127
|
-
|
|
128
|
-
/** WebGPU renderer type - re-exported as R3FRenderer from @react-three/fiber/webgpu */
|
|
129
|
-
type WebGPUR3FRenderer = WebGPURenderer
|
|
130
|
-
|
|
131
|
-
/** WebGPU internal state with narrowed renderer type */
|
|
132
|
-
interface WebGPUInternalState extends Omit<InternalState, 'actualRenderer'> {
|
|
133
|
-
actualRenderer: WebGPURenderer
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* WebGPU-specific RootState with narrowed renderer type.
|
|
138
|
-
* Automatically used when importing from `@react-three/fiber/webgpu`.
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* ```tsx
|
|
142
|
-
* import { useThree } from '@react-three/fiber/webgpu'
|
|
143
|
-
*
|
|
144
|
-
* function MyComponent() {
|
|
145
|
-
* const { renderer } = useThree()
|
|
146
|
-
* // renderer is typed as WebGPURenderer
|
|
147
|
-
* renderer.compute(computePass)
|
|
148
|
-
* }
|
|
149
|
-
* ```
|
|
150
|
-
*/
|
|
151
|
-
interface WebGPURootState extends Omit<RootState, 'renderer' | 'gl' | 'internal'> {
|
|
152
|
-
/** @deprecated Use `renderer` instead */
|
|
153
|
-
gl: WebGPURenderer
|
|
154
|
-
/** The WebGPU renderer instance */
|
|
155
|
-
renderer: WebGPURenderer
|
|
156
|
-
/** Internals with WebGPU renderer */
|
|
157
|
-
internal: WebGPUInternalState
|
|
158
|
-
}
|
|
159
|
-
|
|
160
111
|
declare const R3F_BUILD_LEGACY = false;
|
|
161
112
|
declare const R3F_BUILD_WEBGPU = true;
|
|
162
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Create a root that always constructs a WebGPURenderer.
|
|
115
|
+
* @deprecated `@react-three/fiber/webgpu` is removed in the first v10 beta. Import `createRoot` from
|
|
116
|
+
* `@react-three/fiber`, which renders with WebGPU and has the same types.
|
|
117
|
+
*/
|
|
163
118
|
declare function createRoot<TCanvas extends HTMLCanvasElement | OffscreenCanvas>(canvas: TCanvas): ReconcilerRoot<TCanvas>;
|
|
164
119
|
|
|
165
|
-
/** `useThree` narrowed to WebGPU state — `state.renderer` is a `WebGPURenderer`. */
|
|
166
|
-
type UseThreeWebGPU = <T = WebGPURootState>(selector?: (state: WebGPURootState) => T, equalityFn?: <U>(state: U, newState: U) => boolean) => T;
|
|
167
|
-
/** `useFrame` narrowed to WebGPU state — the callback's `state.renderer` is a `WebGPURenderer`. */
|
|
168
|
-
type UseFrameWebGPU = (callback?: FrameCallback<WebGPURootState>, priorityOrOptions?: number | UseFrameNextOptions) => FrameNextControls;
|
|
169
|
-
declare const useThree: UseThreeWebGPU;
|
|
170
|
-
declare const useFrame: UseFrameWebGPU;
|
|
171
|
-
/** `useRenderTarget` narrowed to the target this entry's renderer produces. */
|
|
172
|
-
declare const useRenderTarget: {
|
|
173
|
-
(options?: RenderTargetOptions): RenderTarget;
|
|
174
|
-
(size: number, options?: RenderTargetOptions): RenderTarget;
|
|
175
|
-
(width: number, height: number, options?: RenderTargetOptions): RenderTarget;
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
/** Canvas props on the WebGPU entry: `onCreated` receives `WebGPURootState`. */
|
|
179
|
-
type WebGPUCanvasProps = Omit<CanvasProps, 'onCreated'> & {
|
|
180
|
-
/** Callback after the canvas has rendered (but not yet committed); `state.renderer` is a `WebGPURenderer` */
|
|
181
|
-
onCreated?: (state: WebGPURootState) => void;
|
|
182
|
-
};
|
|
183
|
-
|
|
184
120
|
/**
|
|
185
121
|
* A DOM canvas which accepts threejs elements as children, rendered with WebGPU. `onCreated` is
|
|
186
122
|
* typed against `WebGPURootState`.
|
|
123
|
+
* @deprecated `@react-three/fiber/webgpu` is removed in the first v10 beta. Import `Canvas` from
|
|
124
|
+
* `@react-three/fiber`, which renders with WebGPU and has the same types.
|
|
187
125
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
188
126
|
*/
|
|
189
|
-
declare const Canvas: (props:
|
|
127
|
+
declare const Canvas: (props: _react_three_fiber.CanvasProps) => React.JSX.Element;
|
|
190
128
|
/** Three.js constructors available as JSX elements on this entry. */
|
|
191
129
|
type ThreeExports = typeof ThreeWebGPU;
|
|
192
130
|
interface ThreeElements extends ThreeElementsOf$1<ThreeExports> {
|
|
@@ -198,5 +136,5 @@ declare module 'react' {
|
|
|
198
136
|
}
|
|
199
137
|
}
|
|
200
138
|
|
|
201
|
-
export {
|
|
202
|
-
export type {
|
|
139
|
+
export { RootState as BaseRootState, Canvas, Color$1 as Color, ConstructorRepresentation, ElementOf$1 as ElementOf, ElementProps$1 as ElementProps, Euler$1 as Euler, EventProps$1 as EventProps, GeometryProps$1 as GeometryProps, GeometryTransformProps$1 as GeometryTransformProps, Layers$1 as Layers, MathProps$1 as MathProps, MathRepresentation$1 as MathRepresentation, MathType$1 as MathType, MathTypes$1 as MathTypes, Matrix3$1 as Matrix3, Matrix4$1 as Matrix4, MutableOrReadonlyParameters$1 as MutableOrReadonlyParameters, NodeProps$1 as NodeProps, Object3DMethod$1 as Object3DMethod, Quaternion$1 as Quaternion, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, RaycastableRepresentation$1 as RaycastableRepresentation, ReactProps$1 as ReactProps, webgpu_d as ReactThreeFiber, ReconcilerRoot, TSLNodeInput$1 as TSLNodeInput, ThreeElement$1 as ThreeElement, ThreeElementsOf$1 as ThreeElementsOf, ThreeToJSXElements$1 as ThreeToJSXElements, Vector2$1 as Vector2, Vector3$1 as Vector3, Vector4$1 as Vector4, VectorRepresentation$1 as VectorRepresentation, createRoot, createTextureOperations };
|
|
140
|
+
export type { TextureEntry, TextureNode, TextureOperations, ThreeElements, ThreeExports };
|
package/dist/webgpu/index.d.mts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import * as ThreeWebGPU from 'three/webgpu';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export {
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as _react_three_fiber from '@react-three/fiber';
|
|
4
|
+
import { M as MutableOrReadonlyParameters$1, a as MathRepresentation$1, V as VectorRepresentation$1, b as MathTypes$1, c as MathType$1, d as MathProps$1, e as Vector2$1, f as Vector3$1, g as Vector4$1, C as Color$1, L as Layers$1, Q as Quaternion$1, E as Euler$1, h as Matrix3$1, i as Matrix4$1, R as RaycastableRepresentation$1, j as EventProps$1, G as GeometryTransformProps$1, k as GeometryProps$1, T as TSLNodeInput$1, N as NodeProps$1, l as ReactProps$1, m as ConstructorRepresentation, n as ElementProps$1, o as ThreeElement$1, p as ThreeToJSXElements$1, O as Object3DMethod$1, q as ThreeElementsOf$1, r as ElementOf$1, H as RootState, s as ReconcilerRoot } from '../shared/fiber.DQTSZ24m.mjs';
|
|
5
|
+
export { aE as Act, as as Args, at as ArgsProp, ap as AttachFnType, aq as AttachType, a7 as BaseRendererProps, aF as Bridge, U as Camera, aj as CameraProps, ag as CanvasSchedulerConfig, ar as Catalogue, aa as ColorManagementConfig, a1 as ComputeFunction, ad as DefaultGLProps, af as DefaultRendererProps, aK as Disposable, Z as DomEvent, D as Dpr, aJ as EquConfig, $ as EventHandlers, a3 as EventManager, _ as Events, am as FiberRoot, a0 as FilterFunction, aY as ForRegisteredRenderer, aO as FrameCallback, aN as FrameNextCallback, aL as FrameNextState, aM as FrameState, F as Frameloop, ae as GLProps, aw as HostConfig, al as InjectState, av as Instance, au as InstanceProps, K as Intersection, W as IntersectionEvent, aC as IsAllOptional, aB as IsOptional, aA as Mutable, ax as NonFunctionKeys, aI as ObjectMap, aR as OcclusionSupport, a6 as OffscreenCanvas, ay as Overwrite, B as Performance, a4 as PointerCaptureTarget, P as PointerState, az as Properties, aZ as R3FRenderTarget, a_ as R3FRendererSupport, aW as Register, aX as RegisteredRenderer, A as RenderCallback, ak as RenderProps, a9 as Renderer, ah as RendererConfigExtended, a8 as RendererFactory, ai as RendererProps, aV as RendererProvider, ac as RendererSettingsConfig, aU as RendererSupport, ao as Root, v as RootExtension, J as RootStore, aG as SetBlock, ab as ShadowsConfig, y as Size, S as Subscription, aD as ThreeCamera, aQ as ThreeCore, Y as ThreeEvent, aP as ThreeNamespace, an as TrackedPromise, aH as UnblockProps, z as Viewport, a5 as VisibilityEntry, aS as WebGLSupport, aT as WebGPUSupport, X as XRManager, a2 as XRPointerConfig, w as context, t as registerRootExtension, u as setRenderOverride, a$ as useStore } from '../shared/fiber.DQTSZ24m.mjs';
|
|
6
|
+
export { B as BackgroundConfig, p as BackgroundProp, ah as Block, a2 as DisposeOptions, K as Environment, H as EnvironmentCube, a5 as EnvironmentLoaderProps, F as EnvironmentMap, J as EnvironmentPortal, D as EnvironmentProps, ai as ErrorBoundary, E as Extensions, aM as FROM_REF, aN as FromRefMarker, q as GLTFLike, o as GlobalEffectType, G as GlobalRenderCallback, t as InferLoadResult, I as InputLike, X as IsObject, A as LegacyInternalState, z as LegacyRenderer, C as LegacyRootState, s as LoaderInstance, L as LoaderLike, v as LoaderResult, Y as MappedTextureType, aQ as ONCE, aS as OnceValue, ad as Portal, N as PresetsType, P as PrimaryCanvasEntry, an as REACT_INTERNAL_PROPS, av as RESERVED_PROPS, R as RenderTargetOptions, $ as Texture, a0 as TextureInput, a1 as TextureResult, Z as UseTextureOptions, a3 as UseTexturesReturn, W as WebGLDefaultProps, x as WebGLProps, y as WebGLShadowConfig, aa as _roots, b as addAfterEffect, a as addEffect, d as addTail, e as advance, aA as applyProps, ax as attach, aq as buildGraph, aj as calculateDpr, S as createEvents, c as createPointerEvents, ac as createPortal, k as createStore, ay as detach, az as diffProps, ar as dispose, c as events, a7 as extend, ao as findInitialRoot, a9 as flushSync, aO as fromRef, as as getInstanceProps, g as getPrimary, j as getPrimaryIds, ap as getRootState, l as getThree, ak as getUuidPrefix, aL as hasConstructor, h as hasPrimary, m as hasThree, i as invalidate, au as invalidateInstance, aB as is, aE as isColorRepresentation, aK as isCopyable, aP as isFromRef, aH as isLayers, aF as isObject3D, aT as isOnce, aC as isOrthographicCamera, aD as isRef, f as isRenderer, aG as isTexture, aI as isUniform, aJ as isVectorLike, aR as once, at as prepare, M as presetsObj, a8 as reconciler, r as registerPrimary, Q as removeInteractivity, aw as resolve, O as swapInteractivity, ab as unmountComponentAtNode, u as unregisterPrimary, al as updateCamera, am as updateFrustum, ag as useBridge, a6 as useEnvironment, U as useGraph, T as useInstanceHandle, ae as useIsomorphicLayoutEffect, V as useLoader, af as useMutableCallback, _ as useTexture, a4 as useTextures, w as waitForPrimary, n as whenThree } from '../shared/fiber.Dy7Uz273.mjs';
|
|
7
7
|
import { Texture } from 'three';
|
|
8
8
|
import { StoreApi } from 'zustand';
|
|
9
|
-
|
|
9
|
+
export { W as CanvasProps, e as InternalState, f as R3FRenderer, d as RootState, c as UseFrameWebGPU, U as UseThreeWebGPU, W as WebGPUCanvasProps, h as WebGPUDefaultProps, g as WebGPUProps, i as WebGPUShadowConfig, a as useFrame, b as useRenderTarget, u as useThree } from '../shared/fiber.Bll9fqKA.mjs';
|
|
10
10
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
11
|
-
import { JSX } from 'react';
|
|
12
|
-
import 'react-use-measure';
|
|
13
|
-
import 'react/jsx-runtime';
|
|
14
11
|
import 'zustand/traditional';
|
|
15
12
|
import 'three/tsl';
|
|
13
|
+
import 'react-use-measure';
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
16
|
* The `ReactThreeFiber` namespace of the WebGPU entry: the shared element types plus this entry's JSX map.
|
|
@@ -110,83 +108,23 @@ interface TextureOperations {
|
|
|
110
108
|
}
|
|
111
109
|
declare function createTextureOperations(set: StoreApi<RootState>['setState']): TextureOperations;
|
|
112
110
|
|
|
113
|
-
//* Renderer Props ========================================
|
|
114
|
-
|
|
115
|
-
type WebGPUDefaultProps = Omit<WebGPURendererParameters, 'canvas'> & BaseRendererProps
|
|
116
|
-
|
|
117
|
-
type WebGPUProps =
|
|
118
|
-
| RendererFactory<WebGPURenderer, WebGPUDefaultProps>
|
|
119
|
-
| Partial<Properties<WebGPURenderer> | WebGPURendererParameters>
|
|
120
|
-
|
|
121
|
-
// WebGPU doesn't have shadow maps in the same way
|
|
122
|
-
interface WebGPUShadowConfig {
|
|
123
|
-
shadows?: boolean // Simplified for WebGPU
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
//* WebGPU-specific Types ========================================
|
|
127
|
-
|
|
128
|
-
/** WebGPU renderer type - re-exported as R3FRenderer from @react-three/fiber/webgpu */
|
|
129
|
-
type WebGPUR3FRenderer = WebGPURenderer
|
|
130
|
-
|
|
131
|
-
/** WebGPU internal state with narrowed renderer type */
|
|
132
|
-
interface WebGPUInternalState extends Omit<InternalState, 'actualRenderer'> {
|
|
133
|
-
actualRenderer: WebGPURenderer
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* WebGPU-specific RootState with narrowed renderer type.
|
|
138
|
-
* Automatically used when importing from `@react-three/fiber/webgpu`.
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* ```tsx
|
|
142
|
-
* import { useThree } from '@react-three/fiber/webgpu'
|
|
143
|
-
*
|
|
144
|
-
* function MyComponent() {
|
|
145
|
-
* const { renderer } = useThree()
|
|
146
|
-
* // renderer is typed as WebGPURenderer
|
|
147
|
-
* renderer.compute(computePass)
|
|
148
|
-
* }
|
|
149
|
-
* ```
|
|
150
|
-
*/
|
|
151
|
-
interface WebGPURootState extends Omit<RootState, 'renderer' | 'gl' | 'internal'> {
|
|
152
|
-
/** @deprecated Use `renderer` instead */
|
|
153
|
-
gl: WebGPURenderer
|
|
154
|
-
/** The WebGPU renderer instance */
|
|
155
|
-
renderer: WebGPURenderer
|
|
156
|
-
/** Internals with WebGPU renderer */
|
|
157
|
-
internal: WebGPUInternalState
|
|
158
|
-
}
|
|
159
|
-
|
|
160
111
|
declare const R3F_BUILD_LEGACY = false;
|
|
161
112
|
declare const R3F_BUILD_WEBGPU = true;
|
|
162
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Create a root that always constructs a WebGPURenderer.
|
|
115
|
+
* @deprecated `@react-three/fiber/webgpu` is removed in the first v10 beta. Import `createRoot` from
|
|
116
|
+
* `@react-three/fiber`, which renders with WebGPU and has the same types.
|
|
117
|
+
*/
|
|
163
118
|
declare function createRoot<TCanvas extends HTMLCanvasElement | OffscreenCanvas>(canvas: TCanvas): ReconcilerRoot<TCanvas>;
|
|
164
119
|
|
|
165
|
-
/** `useThree` narrowed to WebGPU state — `state.renderer` is a `WebGPURenderer`. */
|
|
166
|
-
type UseThreeWebGPU = <T = WebGPURootState>(selector?: (state: WebGPURootState) => T, equalityFn?: <U>(state: U, newState: U) => boolean) => T;
|
|
167
|
-
/** `useFrame` narrowed to WebGPU state — the callback's `state.renderer` is a `WebGPURenderer`. */
|
|
168
|
-
type UseFrameWebGPU = (callback?: FrameCallback<WebGPURootState>, priorityOrOptions?: number | UseFrameNextOptions) => FrameNextControls;
|
|
169
|
-
declare const useThree: UseThreeWebGPU;
|
|
170
|
-
declare const useFrame: UseFrameWebGPU;
|
|
171
|
-
/** `useRenderTarget` narrowed to the target this entry's renderer produces. */
|
|
172
|
-
declare const useRenderTarget: {
|
|
173
|
-
(options?: RenderTargetOptions): RenderTarget;
|
|
174
|
-
(size: number, options?: RenderTargetOptions): RenderTarget;
|
|
175
|
-
(width: number, height: number, options?: RenderTargetOptions): RenderTarget;
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
/** Canvas props on the WebGPU entry: `onCreated` receives `WebGPURootState`. */
|
|
179
|
-
type WebGPUCanvasProps = Omit<CanvasProps, 'onCreated'> & {
|
|
180
|
-
/** Callback after the canvas has rendered (but not yet committed); `state.renderer` is a `WebGPURenderer` */
|
|
181
|
-
onCreated?: (state: WebGPURootState) => void;
|
|
182
|
-
};
|
|
183
|
-
|
|
184
120
|
/**
|
|
185
121
|
* A DOM canvas which accepts threejs elements as children, rendered with WebGPU. `onCreated` is
|
|
186
122
|
* typed against `WebGPURootState`.
|
|
123
|
+
* @deprecated `@react-three/fiber/webgpu` is removed in the first v10 beta. Import `Canvas` from
|
|
124
|
+
* `@react-three/fiber`, which renders with WebGPU and has the same types.
|
|
187
125
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
188
126
|
*/
|
|
189
|
-
declare const Canvas: (props:
|
|
127
|
+
declare const Canvas: (props: _react_three_fiber.CanvasProps) => React.JSX.Element;
|
|
190
128
|
/** Three.js constructors available as JSX elements on this entry. */
|
|
191
129
|
type ThreeExports = typeof ThreeWebGPU;
|
|
192
130
|
interface ThreeElements extends ThreeElementsOf$1<ThreeExports> {
|
|
@@ -198,5 +136,5 @@ declare module 'react' {
|
|
|
198
136
|
}
|
|
199
137
|
}
|
|
200
138
|
|
|
201
|
-
export {
|
|
202
|
-
export type {
|
|
139
|
+
export { RootState as BaseRootState, Canvas, Color$1 as Color, ConstructorRepresentation, ElementOf$1 as ElementOf, ElementProps$1 as ElementProps, Euler$1 as Euler, EventProps$1 as EventProps, GeometryProps$1 as GeometryProps, GeometryTransformProps$1 as GeometryTransformProps, Layers$1 as Layers, MathProps$1 as MathProps, MathRepresentation$1 as MathRepresentation, MathType$1 as MathType, MathTypes$1 as MathTypes, Matrix3$1 as Matrix3, Matrix4$1 as Matrix4, MutableOrReadonlyParameters$1 as MutableOrReadonlyParameters, NodeProps$1 as NodeProps, Object3DMethod$1 as Object3DMethod, Quaternion$1 as Quaternion, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, RaycastableRepresentation$1 as RaycastableRepresentation, ReactProps$1 as ReactProps, webgpu_d as ReactThreeFiber, ReconcilerRoot, TSLNodeInput$1 as TSLNodeInput, ThreeElement$1 as ThreeElement, ThreeElementsOf$1 as ThreeElementsOf, ThreeToJSXElements$1 as ThreeToJSXElements, Vector2$1 as Vector2, Vector3$1 as Vector3, Vector4$1 as Vector4, VectorRepresentation$1 as VectorRepresentation, createRoot, createTextureOperations };
|
|
140
|
+
export type { TextureEntry, TextureNode, TextureOperations, ThreeElements, ThreeExports };
|
package/dist/webgpu/index.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import * as ThreeWebGPU from 'three/webgpu';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export {
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as _react_three_fiber from '@react-three/fiber';
|
|
4
|
+
import { M as MutableOrReadonlyParameters$1, a as MathRepresentation$1, V as VectorRepresentation$1, b as MathTypes$1, c as MathType$1, d as MathProps$1, e as Vector2$1, f as Vector3$1, g as Vector4$1, C as Color$1, L as Layers$1, Q as Quaternion$1, E as Euler$1, h as Matrix3$1, i as Matrix4$1, R as RaycastableRepresentation$1, j as EventProps$1, G as GeometryTransformProps$1, k as GeometryProps$1, T as TSLNodeInput$1, N as NodeProps$1, l as ReactProps$1, m as ConstructorRepresentation, n as ElementProps$1, o as ThreeElement$1, p as ThreeToJSXElements$1, O as Object3DMethod$1, q as ThreeElementsOf$1, r as ElementOf$1, H as RootState, s as ReconcilerRoot } from '../shared/fiber.DQTSZ24m.js';
|
|
5
|
+
export { aE as Act, as as Args, at as ArgsProp, ap as AttachFnType, aq as AttachType, a7 as BaseRendererProps, aF as Bridge, U as Camera, aj as CameraProps, ag as CanvasSchedulerConfig, ar as Catalogue, aa as ColorManagementConfig, a1 as ComputeFunction, ad as DefaultGLProps, af as DefaultRendererProps, aK as Disposable, Z as DomEvent, D as Dpr, aJ as EquConfig, $ as EventHandlers, a3 as EventManager, _ as Events, am as FiberRoot, a0 as FilterFunction, aY as ForRegisteredRenderer, aO as FrameCallback, aN as FrameNextCallback, aL as FrameNextState, aM as FrameState, F as Frameloop, ae as GLProps, aw as HostConfig, al as InjectState, av as Instance, au as InstanceProps, K as Intersection, W as IntersectionEvent, aC as IsAllOptional, aB as IsOptional, aA as Mutable, ax as NonFunctionKeys, aI as ObjectMap, aR as OcclusionSupport, a6 as OffscreenCanvas, ay as Overwrite, B as Performance, a4 as PointerCaptureTarget, P as PointerState, az as Properties, aZ as R3FRenderTarget, a_ as R3FRendererSupport, aW as Register, aX as RegisteredRenderer, A as RenderCallback, ak as RenderProps, a9 as Renderer, ah as RendererConfigExtended, a8 as RendererFactory, ai as RendererProps, aV as RendererProvider, ac as RendererSettingsConfig, aU as RendererSupport, ao as Root, v as RootExtension, J as RootStore, aG as SetBlock, ab as ShadowsConfig, y as Size, S as Subscription, aD as ThreeCamera, aQ as ThreeCore, Y as ThreeEvent, aP as ThreeNamespace, an as TrackedPromise, aH as UnblockProps, z as Viewport, a5 as VisibilityEntry, aS as WebGLSupport, aT as WebGPUSupport, X as XRManager, a2 as XRPointerConfig, w as context, t as registerRootExtension, u as setRenderOverride, a$ as useStore } from '../shared/fiber.DQTSZ24m.js';
|
|
6
|
+
export { B as BackgroundConfig, p as BackgroundProp, ah as Block, a2 as DisposeOptions, K as Environment, H as EnvironmentCube, a5 as EnvironmentLoaderProps, F as EnvironmentMap, J as EnvironmentPortal, D as EnvironmentProps, ai as ErrorBoundary, E as Extensions, aM as FROM_REF, aN as FromRefMarker, q as GLTFLike, o as GlobalEffectType, G as GlobalRenderCallback, t as InferLoadResult, I as InputLike, X as IsObject, A as LegacyInternalState, z as LegacyRenderer, C as LegacyRootState, s as LoaderInstance, L as LoaderLike, v as LoaderResult, Y as MappedTextureType, aQ as ONCE, aS as OnceValue, ad as Portal, N as PresetsType, P as PrimaryCanvasEntry, an as REACT_INTERNAL_PROPS, av as RESERVED_PROPS, R as RenderTargetOptions, $ as Texture, a0 as TextureInput, a1 as TextureResult, Z as UseTextureOptions, a3 as UseTexturesReturn, W as WebGLDefaultProps, x as WebGLProps, y as WebGLShadowConfig, aa as _roots, b as addAfterEffect, a as addEffect, d as addTail, e as advance, aA as applyProps, ax as attach, aq as buildGraph, aj as calculateDpr, S as createEvents, c as createPointerEvents, ac as createPortal, k as createStore, ay as detach, az as diffProps, ar as dispose, c as events, a7 as extend, ao as findInitialRoot, a9 as flushSync, aO as fromRef, as as getInstanceProps, g as getPrimary, j as getPrimaryIds, ap as getRootState, l as getThree, ak as getUuidPrefix, aL as hasConstructor, h as hasPrimary, m as hasThree, i as invalidate, au as invalidateInstance, aB as is, aE as isColorRepresentation, aK as isCopyable, aP as isFromRef, aH as isLayers, aF as isObject3D, aT as isOnce, aC as isOrthographicCamera, aD as isRef, f as isRenderer, aG as isTexture, aI as isUniform, aJ as isVectorLike, aR as once, at as prepare, M as presetsObj, a8 as reconciler, r as registerPrimary, Q as removeInteractivity, aw as resolve, O as swapInteractivity, ab as unmountComponentAtNode, u as unregisterPrimary, al as updateCamera, am as updateFrustum, ag as useBridge, a6 as useEnvironment, U as useGraph, T as useInstanceHandle, ae as useIsomorphicLayoutEffect, V as useLoader, af as useMutableCallback, _ as useTexture, a4 as useTextures, w as waitForPrimary, n as whenThree } from '../shared/fiber.CjMAAsJy.js';
|
|
7
7
|
import { Texture } from 'three';
|
|
8
8
|
import { StoreApi } from 'zustand';
|
|
9
|
-
|
|
9
|
+
export { W as CanvasProps, e as InternalState, f as R3FRenderer, d as RootState, c as UseFrameWebGPU, U as UseThreeWebGPU, W as WebGPUCanvasProps, h as WebGPUDefaultProps, g as WebGPUProps, i as WebGPUShadowConfig, a as useFrame, b as useRenderTarget, u as useThree } from '../shared/fiber.DuA4F8L5.js';
|
|
10
10
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
11
|
-
import { JSX } from 'react';
|
|
12
|
-
import 'react-use-measure';
|
|
13
|
-
import 'react/jsx-runtime';
|
|
14
11
|
import 'zustand/traditional';
|
|
15
12
|
import 'three/tsl';
|
|
13
|
+
import 'react-use-measure';
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
16
|
* The `ReactThreeFiber` namespace of the WebGPU entry: the shared element types plus this entry's JSX map.
|
|
@@ -110,83 +108,23 @@ interface TextureOperations {
|
|
|
110
108
|
}
|
|
111
109
|
declare function createTextureOperations(set: StoreApi<RootState>['setState']): TextureOperations;
|
|
112
110
|
|
|
113
|
-
//* Renderer Props ========================================
|
|
114
|
-
|
|
115
|
-
type WebGPUDefaultProps = Omit<WebGPURendererParameters, 'canvas'> & BaseRendererProps
|
|
116
|
-
|
|
117
|
-
type WebGPUProps =
|
|
118
|
-
| RendererFactory<WebGPURenderer, WebGPUDefaultProps>
|
|
119
|
-
| Partial<Properties<WebGPURenderer> | WebGPURendererParameters>
|
|
120
|
-
|
|
121
|
-
// WebGPU doesn't have shadow maps in the same way
|
|
122
|
-
interface WebGPUShadowConfig {
|
|
123
|
-
shadows?: boolean // Simplified for WebGPU
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
//* WebGPU-specific Types ========================================
|
|
127
|
-
|
|
128
|
-
/** WebGPU renderer type - re-exported as R3FRenderer from @react-three/fiber/webgpu */
|
|
129
|
-
type WebGPUR3FRenderer = WebGPURenderer
|
|
130
|
-
|
|
131
|
-
/** WebGPU internal state with narrowed renderer type */
|
|
132
|
-
interface WebGPUInternalState extends Omit<InternalState, 'actualRenderer'> {
|
|
133
|
-
actualRenderer: WebGPURenderer
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* WebGPU-specific RootState with narrowed renderer type.
|
|
138
|
-
* Automatically used when importing from `@react-three/fiber/webgpu`.
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* ```tsx
|
|
142
|
-
* import { useThree } from '@react-three/fiber/webgpu'
|
|
143
|
-
*
|
|
144
|
-
* function MyComponent() {
|
|
145
|
-
* const { renderer } = useThree()
|
|
146
|
-
* // renderer is typed as WebGPURenderer
|
|
147
|
-
* renderer.compute(computePass)
|
|
148
|
-
* }
|
|
149
|
-
* ```
|
|
150
|
-
*/
|
|
151
|
-
interface WebGPURootState extends Omit<RootState, 'renderer' | 'gl' | 'internal'> {
|
|
152
|
-
/** @deprecated Use `renderer` instead */
|
|
153
|
-
gl: WebGPURenderer
|
|
154
|
-
/** The WebGPU renderer instance */
|
|
155
|
-
renderer: WebGPURenderer
|
|
156
|
-
/** Internals with WebGPU renderer */
|
|
157
|
-
internal: WebGPUInternalState
|
|
158
|
-
}
|
|
159
|
-
|
|
160
111
|
declare const R3F_BUILD_LEGACY = false;
|
|
161
112
|
declare const R3F_BUILD_WEBGPU = true;
|
|
162
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Create a root that always constructs a WebGPURenderer.
|
|
115
|
+
* @deprecated `@react-three/fiber/webgpu` is removed in the first v10 beta. Import `createRoot` from
|
|
116
|
+
* `@react-three/fiber`, which renders with WebGPU and has the same types.
|
|
117
|
+
*/
|
|
163
118
|
declare function createRoot<TCanvas extends HTMLCanvasElement | OffscreenCanvas>(canvas: TCanvas): ReconcilerRoot<TCanvas>;
|
|
164
119
|
|
|
165
|
-
/** `useThree` narrowed to WebGPU state — `state.renderer` is a `WebGPURenderer`. */
|
|
166
|
-
type UseThreeWebGPU = <T = WebGPURootState>(selector?: (state: WebGPURootState) => T, equalityFn?: <U>(state: U, newState: U) => boolean) => T;
|
|
167
|
-
/** `useFrame` narrowed to WebGPU state — the callback's `state.renderer` is a `WebGPURenderer`. */
|
|
168
|
-
type UseFrameWebGPU = (callback?: FrameCallback<WebGPURootState>, priorityOrOptions?: number | UseFrameNextOptions) => FrameNextControls;
|
|
169
|
-
declare const useThree: UseThreeWebGPU;
|
|
170
|
-
declare const useFrame: UseFrameWebGPU;
|
|
171
|
-
/** `useRenderTarget` narrowed to the target this entry's renderer produces. */
|
|
172
|
-
declare const useRenderTarget: {
|
|
173
|
-
(options?: RenderTargetOptions): RenderTarget;
|
|
174
|
-
(size: number, options?: RenderTargetOptions): RenderTarget;
|
|
175
|
-
(width: number, height: number, options?: RenderTargetOptions): RenderTarget;
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
/** Canvas props on the WebGPU entry: `onCreated` receives `WebGPURootState`. */
|
|
179
|
-
type WebGPUCanvasProps = Omit<CanvasProps, 'onCreated'> & {
|
|
180
|
-
/** Callback after the canvas has rendered (but not yet committed); `state.renderer` is a `WebGPURenderer` */
|
|
181
|
-
onCreated?: (state: WebGPURootState) => void;
|
|
182
|
-
};
|
|
183
|
-
|
|
184
120
|
/**
|
|
185
121
|
* A DOM canvas which accepts threejs elements as children, rendered with WebGPU. `onCreated` is
|
|
186
122
|
* typed against `WebGPURootState`.
|
|
123
|
+
* @deprecated `@react-three/fiber/webgpu` is removed in the first v10 beta. Import `Canvas` from
|
|
124
|
+
* `@react-three/fiber`, which renders with WebGPU and has the same types.
|
|
187
125
|
* @see https://docs.pmnd.rs/react-three-fiber/api/canvas
|
|
188
126
|
*/
|
|
189
|
-
declare const Canvas: (props:
|
|
127
|
+
declare const Canvas: (props: _react_three_fiber.CanvasProps) => React.JSX.Element;
|
|
190
128
|
/** Three.js constructors available as JSX elements on this entry. */
|
|
191
129
|
type ThreeExports = typeof ThreeWebGPU;
|
|
192
130
|
interface ThreeElements extends ThreeElementsOf$1<ThreeExports> {
|
|
@@ -198,5 +136,5 @@ declare module 'react' {
|
|
|
198
136
|
}
|
|
199
137
|
}
|
|
200
138
|
|
|
201
|
-
export {
|
|
202
|
-
export type {
|
|
139
|
+
export { RootState as BaseRootState, Canvas, Color$1 as Color, ConstructorRepresentation, ElementOf$1 as ElementOf, ElementProps$1 as ElementProps, Euler$1 as Euler, EventProps$1 as EventProps, GeometryProps$1 as GeometryProps, GeometryTransformProps$1 as GeometryTransformProps, Layers$1 as Layers, MathProps$1 as MathProps, MathRepresentation$1 as MathRepresentation, MathType$1 as MathType, MathTypes$1 as MathTypes, Matrix3$1 as Matrix3, Matrix4$1 as Matrix4, MutableOrReadonlyParameters$1 as MutableOrReadonlyParameters, NodeProps$1 as NodeProps, Object3DMethod$1 as Object3DMethod, Quaternion$1 as Quaternion, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, RaycastableRepresentation$1 as RaycastableRepresentation, ReactProps$1 as ReactProps, webgpu_d as ReactThreeFiber, ReconcilerRoot, TSLNodeInput$1 as TSLNodeInput, ThreeElement$1 as ThreeElement, ThreeElementsOf$1 as ThreeElementsOf, ThreeToJSXElements$1 as ThreeToJSXElements, Vector2$1 as Vector2, Vector3$1 as Vector3, Vector4$1 as Vector4, VectorRepresentation$1 as VectorRepresentation, createRoot, createTextureOperations };
|
|
140
|
+
export type { TextureEntry, TextureNode, TextureOperations, ThreeElements, ThreeExports };
|
package/dist/webgpu/index.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { c as createRoot$1, C as Canvas$1 } from '../shared/fiber.BSYBnw8x.mjs';
|
|
3
|
+
export { s as Environment, p as EnvironmentCube, E as EnvironmentMap, q as EnvironmentPortal, ah as FROM_REF, I as IsObject, ak as ONCE, P as Portal, S as REACT_INTERNAL_PROPS, a0 as RESERVED_PROPS, T as Texture, _ as _roots, d as addAfterEffect, b as addEffect, e as addTail, f as advance, a5 as applyProps, a2 as attach, W as buildGraph, N as calculateDpr, y as createEvents, a as createPointerEvents, M as createPortal, l as createStore, a3 as detach, a4 as diffProps, X as dispose, a as events, H as extend, U as findInitialRoot, K as flushSync, ai as fromRef, Y as getInstanceProps, h as getPrimary, k as getPrimaryIds, V as getRootState, m as getThree, O as getUuidPrefix, ag as hasConstructor, j as hasPrimary, n as hasThree, i as invalidate, $ as invalidateInstance, a6 as is, a9 as isColorRepresentation, af as isCopyable, aj as isFromRef, ac as isLayers, aa as isObject3D, am as isOnce, a7 as isOrthographicCamera, a8 as isRef, g as isRenderer, ab as isTexture, ad as isUniform, ae as isVectorLike, al as once, Z as prepare, t as presetsObj, J as reconciler, r as registerPrimary, x as removeInteractivity, a1 as resolve, v as swapInteractivity, L as unmountComponentAtNode, u as unregisterPrimary, Q as updateCamera, R as updateFrustum, G as useEnvironment, A as useGraph, z as useInstanceHandle, B as useLoader, D as useTexture, F as useTextures, w as waitForPrimary, o as whenThree } from '../shared/fiber.BSYBnw8x.mjs';
|
|
4
4
|
import { webgpuSupport } from '../chunks/webgpu.mjs';
|
|
5
|
-
import { a as
|
|
6
|
-
export {
|
|
5
|
+
import { a as asWebGPUCanvas } from '../shared/fiber.DUgKvaq-.mjs';
|
|
6
|
+
export { b as useFrame, c as useRenderTarget, u as useThree } from '../shared/fiber.DUgKvaq-.mjs';
|
|
7
|
+
export { B as Block, E as ErrorBoundary, c as context, r as registerRootExtension, s as setRenderOverride, f as useBridge, d as useIsomorphicLayoutEffect, e as useMutableCallback, u as useStore } from '../shared/fiber.Biz9olEe.mjs';
|
|
7
8
|
export { Scheduler, getScheduler } from '@pmndrs/scheduler';
|
|
8
9
|
|
|
9
10
|
function addTexture(set, key, value) {
|
|
@@ -54,9 +55,6 @@ const provider = {
|
|
|
54
55
|
function createRoot(canvas) {
|
|
55
56
|
return createRoot$1(canvas, provider);
|
|
56
57
|
}
|
|
57
|
-
const
|
|
58
|
-
const useFrame = useFrame$1;
|
|
59
|
-
const useRenderTarget = useRenderTarget$1;
|
|
60
|
-
const Canvas = ((props) => /* @__PURE__ */ jsx(Canvas$1, { ...props, provider }));
|
|
58
|
+
const Canvas = asWebGPUCanvas((props) => /* @__PURE__ */ jsx(Canvas$1, { ...props, provider }));
|
|
61
59
|
|
|
62
|
-
export { Canvas, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, createRoot, createTextureOperations
|
|
60
|
+
export { Canvas, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, createRoot, createTextureOperations };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-three/fiber",
|
|
3
|
-
"version": "10.0.0-canary.
|
|
3
|
+
"version": "10.0.0-canary.e78793c",
|
|
4
4
|
"description": "A React renderer for Threejs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -62,24 +62,24 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@babel/runtime": "^7.28.6",
|
|
65
|
-
"@pmndrs/scheduler": "^0.
|
|
65
|
+
"@pmndrs/scheduler": "^0.3.0",
|
|
66
66
|
"dequal": "^2.0.3",
|
|
67
|
-
"its-fine": "^2.
|
|
67
|
+
"its-fine": "^2.1.1",
|
|
68
68
|
"react-use-measure": "^2.1.7",
|
|
69
|
-
"scheduler": "^0.
|
|
69
|
+
"scheduler": "^0.28.0",
|
|
70
70
|
"suspend-react": "^0.1.3",
|
|
71
71
|
"use-sync-external-store": "^1.6.0",
|
|
72
72
|
"zustand": "^5.0.10"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@types/react-reconciler": "^0.
|
|
75
|
+
"@types/react-reconciler": "^0.33.0",
|
|
76
76
|
"@types/three": "^0.185.0",
|
|
77
77
|
"@types/webxr": "*",
|
|
78
|
-
"react-reconciler": "^0.
|
|
78
|
+
"react-reconciler": "^0.34.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"react": ">=19.0 <19.
|
|
82
|
-
"react-dom": ">=19.0 <19.
|
|
81
|
+
"react": ">=19.0 <19.4",
|
|
82
|
+
"react-dom": ">=19.0 <19.4",
|
|
83
83
|
"three": ">=0.185.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependenciesMeta": {
|
package/readme.md
CHANGED
|
@@ -215,7 +215,7 @@ Visit [docs.pmnd.rs](https://docs.pmnd.rs/react-three-fiber) | [Awesome React Th
|
|
|
215
215
|
|
|
216
216
|
You need to be versed in both React and Threejs before rushing into this. If you are unsure about React consult the official [React docs](https://react.dev/learn), especially [the section about hooks](https://react.dev/reference/react). As for Threejs, make sure you at least glance over the following links:
|
|
217
217
|
|
|
218
|
-
1. Make sure you have a [basic grasp of Threejs](https://threejs.org/
|
|
218
|
+
1. Make sure you have a [basic grasp of Threejs](https://threejs.org/manual/#en/creating-a-scene). Keep that site open.
|
|
219
219
|
2. When you know what a scene is, a camera, mesh, geometry, material, fork the [demo above](https://github.com/pmndrs/react-three-fiber#what-does-it-look-like).
|
|
220
220
|
3. [Look up](https://threejs.org/docs/index.html#api/en/objects/Mesh) the JSX elements that you see (mesh, ambientLight, etc), _all_ threejs exports are native to three-fiber.
|
|
221
221
|
4. Try changing some values, scroll through our [API](https://docs.pmnd.rs/react-three-fiber) to see what the various settings and hooks do.
|