@react-three/fiber 10.0.0-canary.76d2134 → 10.0.0-canary.7a50545
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/index.cjs +2454 -2396
- package/dist/index.d.cts +49 -16
- package/dist/index.d.mts +49 -16
- package/dist/index.d.ts +49 -16
- package/dist/index.mjs +2454 -2396
- package/dist/legacy.cjs +2448 -2395
- package/dist/legacy.d.cts +48 -19
- package/dist/legacy.d.mts +48 -19
- package/dist/legacy.d.ts +48 -19
- package/dist/legacy.mjs +2451 -2398
- package/dist/webgpu/index.cjs +2495 -2412
- package/dist/webgpu/index.d.cts +70 -65
- package/dist/webgpu/index.d.mts +70 -65
- package/dist/webgpu/index.d.ts +70 -65
- package/dist/webgpu/index.mjs +2501 -2418
- package/package.json +4 -4
- package/readme.md +1 -1
- package/react-reconciler/constants.d.ts +0 -7
- package/react-reconciler/constants.js +0 -1
- package/react-reconciler/index.d.ts +0 -1044
- package/react-reconciler/index.js +0 -208
package/dist/legacy.d.cts
CHANGED
|
@@ -10,7 +10,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
|
|
|
10
10
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
11
11
|
import { Options } from 'react-use-measure';
|
|
12
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
13
|
-
import { ThreeElement as ThreeElement$1, Euler as Euler$2 } from '@react-three/fiber';
|
|
14
13
|
import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
|
|
15
14
|
|
|
16
15
|
function _mergeNamespaces(n, m) {
|
|
@@ -39,9 +38,9 @@ function _mergeNamespaces(n, m) {
|
|
|
39
38
|
declare const R3F_BUILD_LEGACY = true;
|
|
40
39
|
declare const R3F_BUILD_WEBGPU = false;
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
type Inspector = never;
|
|
42
|
+
/** Not available on the legacy (WebGL-only) entry. */
|
|
43
|
+
declare function loadInspector(): Promise<never>;
|
|
45
44
|
declare const WebGPURenderer: {
|
|
46
45
|
new (): {};
|
|
47
46
|
};
|
|
@@ -59,7 +58,8 @@ var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
|
59
58
|
R3F_BUILD_WEBGPU: R3F_BUILD_WEBGPU,
|
|
60
59
|
RenderTarget: RenderTarget,
|
|
61
60
|
RenderTargetCompat: WebGLRenderTarget,
|
|
62
|
-
WebGPURenderer: WebGPURenderer
|
|
61
|
+
WebGPURenderer: WebGPURenderer,
|
|
62
|
+
loadInspector: loadInspector
|
|
63
63
|
}, [THREE$1]);
|
|
64
64
|
|
|
65
65
|
//* Utility Types ==============================
|
|
@@ -497,6 +497,18 @@ interface InternalState {
|
|
|
497
497
|
* @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
|
|
498
498
|
*/
|
|
499
499
|
canvasTarget?: CanvasTarget
|
|
500
|
+
/**
|
|
501
|
+
* Set when this root's canvas target has been resized and the backend's cached render pass
|
|
502
|
+
* descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
|
|
503
|
+
*
|
|
504
|
+
* Flushed by the canvas-target job in the `start` phase, which is the only place this root's
|
|
505
|
+
* target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
|
|
506
|
+
* whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
|
|
507
|
+
* invalidate some other canvas's descriptor instead.
|
|
508
|
+
*
|
|
509
|
+
* @see https://github.com/pmndrs/react-three-fiber/issues/3847
|
|
510
|
+
*/
|
|
511
|
+
canvasTargetSizeDirty?: boolean
|
|
500
512
|
/**
|
|
501
513
|
* Whether multi-canvas rendering is active.
|
|
502
514
|
* True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
|
|
@@ -706,12 +718,19 @@ type DefaultRendererProps = {
|
|
|
706
718
|
*/
|
|
707
719
|
interface CanvasSchedulerConfig {
|
|
708
720
|
/**
|
|
709
|
-
*
|
|
710
|
-
|
|
721
|
+
* Run this Canvas root before the referenced Canvas root id(s).
|
|
722
|
+
*/
|
|
723
|
+
before?: string | string[]
|
|
724
|
+
/**
|
|
725
|
+
* Run this Canvas root after the referenced Canvas root id(s).
|
|
726
|
+
*/
|
|
727
|
+
after?: string | string[]
|
|
728
|
+
/**
|
|
729
|
+
* Numeric root order. Lower values run first.
|
|
711
730
|
*/
|
|
712
|
-
|
|
731
|
+
order?: number
|
|
713
732
|
/**
|
|
714
|
-
* Limit this
|
|
733
|
+
* Limit this Canvas's default render job (frames per second).
|
|
715
734
|
*/
|
|
716
735
|
fps?: number
|
|
717
736
|
}
|
|
@@ -1315,11 +1334,16 @@ declare global {
|
|
|
1315
1334
|
/** Pass record - stores TSL pass nodes for render pipeline */
|
|
1316
1335
|
type PassRecord = Record<string, any>
|
|
1317
1336
|
|
|
1337
|
+
/** State passed to pipeline callbacks after the active pipeline has been created */
|
|
1338
|
+
type RenderPipelineCallbackState = RootState & {
|
|
1339
|
+
renderPipeline: ThreeRenderPipeline
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1318
1342
|
/** Setup callback - runs first to configure MRT, create additional passes */
|
|
1319
|
-
type RenderPipelineSetupCallback = (state:
|
|
1343
|
+
type RenderPipelineSetupCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1320
1344
|
|
|
1321
1345
|
/** Main callback - runs second to configure outputNode, create effect passes */
|
|
1322
|
-
type RenderPipelineMainCallback = (state:
|
|
1346
|
+
type RenderPipelineMainCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1323
1347
|
|
|
1324
1348
|
/** Return type for useRenderPipeline hook */
|
|
1325
1349
|
interface UseRenderPipelineReturn {
|
|
@@ -1635,9 +1659,9 @@ type EnvironmentProps = {
|
|
|
1635
1659
|
blur?: number;
|
|
1636
1660
|
backgroundBlurriness?: number;
|
|
1637
1661
|
backgroundIntensity?: number;
|
|
1638
|
-
backgroundRotation?: Euler
|
|
1662
|
+
backgroundRotation?: Euler;
|
|
1639
1663
|
environmentIntensity?: number;
|
|
1640
|
-
environmentRotation?: Euler
|
|
1664
|
+
environmentRotation?: Euler;
|
|
1641
1665
|
map?: Texture$1;
|
|
1642
1666
|
preset?: PresetsType;
|
|
1643
1667
|
scene?: Scene | React$1.RefObject<Scene>;
|
|
@@ -1721,7 +1745,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
1721
1745
|
declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1722
1746
|
declare module '@react-three/fiber' {
|
|
1723
1747
|
interface ThreeElements {
|
|
1724
|
-
groundProjectedEnvImpl: ThreeElement
|
|
1748
|
+
groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
|
|
1725
1749
|
}
|
|
1726
1750
|
}
|
|
1727
1751
|
/**
|
|
@@ -1879,7 +1903,7 @@ declare namespace useLoader {
|
|
|
1879
1903
|
*
|
|
1880
1904
|
* @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
|
|
1881
1905
|
* @param priorityOrOptions - Either a priority number (backwards compat) or options object
|
|
1882
|
-
* @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
|
|
1906
|
+
* @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
|
|
1883
1907
|
*
|
|
1884
1908
|
* @example
|
|
1885
1909
|
* // Simple priority (backwards compat)
|
|
@@ -2175,7 +2199,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
|
|
|
2175
2199
|
* Invalidates the view, requesting a frame to be rendered.
|
|
2176
2200
|
* In demand mode, this triggers the scheduler to run frames.
|
|
2177
2201
|
*
|
|
2178
|
-
*
|
|
2202
|
+
* With a state argument, only that root's jobs run on the requested frames; other
|
|
2203
|
+
* roots on 'demand' stay idle. Without one, every registered root is invalidated.
|
|
2204
|
+
*
|
|
2205
|
+
* @param state - Optional root state; targets the invalidation at that root
|
|
2179
2206
|
* @param frames - Number of frames to request (default: 1)
|
|
2180
2207
|
* @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
|
|
2181
2208
|
*
|
|
@@ -2186,14 +2213,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
|
|
|
2186
2213
|
* Advances the frameloop and runs render effects.
|
|
2187
2214
|
* Useful for when manually rendering via `frameloop="never"`.
|
|
2188
2215
|
*
|
|
2216
|
+
* With a state argument, only that root is stepped. Without one, every
|
|
2217
|
+
* registered root is stepped for backwards compatibility.
|
|
2218
|
+
*
|
|
2189
2219
|
* @param timestamp - The timestamp to use for this frame
|
|
2190
2220
|
* @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
|
|
2191
|
-
* @param state -
|
|
2192
|
-
* @param frame - Ignored (kept for backwards compat)
|
|
2221
|
+
* @param state - Optional root state; targets the manual step at that root
|
|
2193
2222
|
*
|
|
2194
2223
|
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
2195
2224
|
*/
|
|
2196
|
-
declare function advance(timestamp: number): void;
|
|
2225
|
+
declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
|
|
2197
2226
|
|
|
2198
2227
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2199
2228
|
declare function ReactReconciler<
|
package/dist/legacy.d.mts
CHANGED
|
@@ -10,7 +10,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
|
|
|
10
10
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
11
11
|
import { Options } from 'react-use-measure';
|
|
12
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
13
|
-
import { ThreeElement as ThreeElement$1, Euler as Euler$2 } from '@react-three/fiber';
|
|
14
13
|
import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
|
|
15
14
|
|
|
16
15
|
function _mergeNamespaces(n, m) {
|
|
@@ -39,9 +38,9 @@ function _mergeNamespaces(n, m) {
|
|
|
39
38
|
declare const R3F_BUILD_LEGACY = true;
|
|
40
39
|
declare const R3F_BUILD_WEBGPU = false;
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
type Inspector = never;
|
|
42
|
+
/** Not available on the legacy (WebGL-only) entry. */
|
|
43
|
+
declare function loadInspector(): Promise<never>;
|
|
45
44
|
declare const WebGPURenderer: {
|
|
46
45
|
new (): {};
|
|
47
46
|
};
|
|
@@ -59,7 +58,8 @@ var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
|
59
58
|
R3F_BUILD_WEBGPU: R3F_BUILD_WEBGPU,
|
|
60
59
|
RenderTarget: RenderTarget,
|
|
61
60
|
RenderTargetCompat: WebGLRenderTarget,
|
|
62
|
-
WebGPURenderer: WebGPURenderer
|
|
61
|
+
WebGPURenderer: WebGPURenderer,
|
|
62
|
+
loadInspector: loadInspector
|
|
63
63
|
}, [THREE$1]);
|
|
64
64
|
|
|
65
65
|
//* Utility Types ==============================
|
|
@@ -497,6 +497,18 @@ interface InternalState {
|
|
|
497
497
|
* @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
|
|
498
498
|
*/
|
|
499
499
|
canvasTarget?: CanvasTarget
|
|
500
|
+
/**
|
|
501
|
+
* Set when this root's canvas target has been resized and the backend's cached render pass
|
|
502
|
+
* descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
|
|
503
|
+
*
|
|
504
|
+
* Flushed by the canvas-target job in the `start` phase, which is the only place this root's
|
|
505
|
+
* target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
|
|
506
|
+
* whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
|
|
507
|
+
* invalidate some other canvas's descriptor instead.
|
|
508
|
+
*
|
|
509
|
+
* @see https://github.com/pmndrs/react-three-fiber/issues/3847
|
|
510
|
+
*/
|
|
511
|
+
canvasTargetSizeDirty?: boolean
|
|
500
512
|
/**
|
|
501
513
|
* Whether multi-canvas rendering is active.
|
|
502
514
|
* True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
|
|
@@ -706,12 +718,19 @@ type DefaultRendererProps = {
|
|
|
706
718
|
*/
|
|
707
719
|
interface CanvasSchedulerConfig {
|
|
708
720
|
/**
|
|
709
|
-
*
|
|
710
|
-
|
|
721
|
+
* Run this Canvas root before the referenced Canvas root id(s).
|
|
722
|
+
*/
|
|
723
|
+
before?: string | string[]
|
|
724
|
+
/**
|
|
725
|
+
* Run this Canvas root after the referenced Canvas root id(s).
|
|
726
|
+
*/
|
|
727
|
+
after?: string | string[]
|
|
728
|
+
/**
|
|
729
|
+
* Numeric root order. Lower values run first.
|
|
711
730
|
*/
|
|
712
|
-
|
|
731
|
+
order?: number
|
|
713
732
|
/**
|
|
714
|
-
* Limit this
|
|
733
|
+
* Limit this Canvas's default render job (frames per second).
|
|
715
734
|
*/
|
|
716
735
|
fps?: number
|
|
717
736
|
}
|
|
@@ -1315,11 +1334,16 @@ declare global {
|
|
|
1315
1334
|
/** Pass record - stores TSL pass nodes for render pipeline */
|
|
1316
1335
|
type PassRecord = Record<string, any>
|
|
1317
1336
|
|
|
1337
|
+
/** State passed to pipeline callbacks after the active pipeline has been created */
|
|
1338
|
+
type RenderPipelineCallbackState = RootState & {
|
|
1339
|
+
renderPipeline: ThreeRenderPipeline
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1318
1342
|
/** Setup callback - runs first to configure MRT, create additional passes */
|
|
1319
|
-
type RenderPipelineSetupCallback = (state:
|
|
1343
|
+
type RenderPipelineSetupCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1320
1344
|
|
|
1321
1345
|
/** Main callback - runs second to configure outputNode, create effect passes */
|
|
1322
|
-
type RenderPipelineMainCallback = (state:
|
|
1346
|
+
type RenderPipelineMainCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1323
1347
|
|
|
1324
1348
|
/** Return type for useRenderPipeline hook */
|
|
1325
1349
|
interface UseRenderPipelineReturn {
|
|
@@ -1635,9 +1659,9 @@ type EnvironmentProps = {
|
|
|
1635
1659
|
blur?: number;
|
|
1636
1660
|
backgroundBlurriness?: number;
|
|
1637
1661
|
backgroundIntensity?: number;
|
|
1638
|
-
backgroundRotation?: Euler
|
|
1662
|
+
backgroundRotation?: Euler;
|
|
1639
1663
|
environmentIntensity?: number;
|
|
1640
|
-
environmentRotation?: Euler
|
|
1664
|
+
environmentRotation?: Euler;
|
|
1641
1665
|
map?: Texture$1;
|
|
1642
1666
|
preset?: PresetsType;
|
|
1643
1667
|
scene?: Scene | React$1.RefObject<Scene>;
|
|
@@ -1721,7 +1745,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
1721
1745
|
declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1722
1746
|
declare module '@react-three/fiber' {
|
|
1723
1747
|
interface ThreeElements {
|
|
1724
|
-
groundProjectedEnvImpl: ThreeElement
|
|
1748
|
+
groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
|
|
1725
1749
|
}
|
|
1726
1750
|
}
|
|
1727
1751
|
/**
|
|
@@ -1879,7 +1903,7 @@ declare namespace useLoader {
|
|
|
1879
1903
|
*
|
|
1880
1904
|
* @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
|
|
1881
1905
|
* @param priorityOrOptions - Either a priority number (backwards compat) or options object
|
|
1882
|
-
* @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
|
|
1906
|
+
* @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
|
|
1883
1907
|
*
|
|
1884
1908
|
* @example
|
|
1885
1909
|
* // Simple priority (backwards compat)
|
|
@@ -2175,7 +2199,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
|
|
|
2175
2199
|
* Invalidates the view, requesting a frame to be rendered.
|
|
2176
2200
|
* In demand mode, this triggers the scheduler to run frames.
|
|
2177
2201
|
*
|
|
2178
|
-
*
|
|
2202
|
+
* With a state argument, only that root's jobs run on the requested frames; other
|
|
2203
|
+
* roots on 'demand' stay idle. Without one, every registered root is invalidated.
|
|
2204
|
+
*
|
|
2205
|
+
* @param state - Optional root state; targets the invalidation at that root
|
|
2179
2206
|
* @param frames - Number of frames to request (default: 1)
|
|
2180
2207
|
* @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
|
|
2181
2208
|
*
|
|
@@ -2186,14 +2213,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
|
|
|
2186
2213
|
* Advances the frameloop and runs render effects.
|
|
2187
2214
|
* Useful for when manually rendering via `frameloop="never"`.
|
|
2188
2215
|
*
|
|
2216
|
+
* With a state argument, only that root is stepped. Without one, every
|
|
2217
|
+
* registered root is stepped for backwards compatibility.
|
|
2218
|
+
*
|
|
2189
2219
|
* @param timestamp - The timestamp to use for this frame
|
|
2190
2220
|
* @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
|
|
2191
|
-
* @param state -
|
|
2192
|
-
* @param frame - Ignored (kept for backwards compat)
|
|
2221
|
+
* @param state - Optional root state; targets the manual step at that root
|
|
2193
2222
|
*
|
|
2194
2223
|
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
2195
2224
|
*/
|
|
2196
|
-
declare function advance(timestamp: number): void;
|
|
2225
|
+
declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
|
|
2197
2226
|
|
|
2198
2227
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2199
2228
|
declare function ReactReconciler<
|
package/dist/legacy.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
|
|
|
10
10
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
11
11
|
import { Options } from 'react-use-measure';
|
|
12
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
13
|
-
import { ThreeElement as ThreeElement$1, Euler as Euler$2 } from '@react-three/fiber';
|
|
14
13
|
import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
|
|
15
14
|
|
|
16
15
|
function _mergeNamespaces(n, m) {
|
|
@@ -39,9 +38,9 @@ function _mergeNamespaces(n, m) {
|
|
|
39
38
|
declare const R3F_BUILD_LEGACY = true;
|
|
40
39
|
declare const R3F_BUILD_WEBGPU = false;
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
type Inspector = never;
|
|
42
|
+
/** Not available on the legacy (WebGL-only) entry. */
|
|
43
|
+
declare function loadInspector(): Promise<never>;
|
|
45
44
|
declare const WebGPURenderer: {
|
|
46
45
|
new (): {};
|
|
47
46
|
};
|
|
@@ -59,7 +58,8 @@ var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
|
59
58
|
R3F_BUILD_WEBGPU: R3F_BUILD_WEBGPU,
|
|
60
59
|
RenderTarget: RenderTarget,
|
|
61
60
|
RenderTargetCompat: WebGLRenderTarget,
|
|
62
|
-
WebGPURenderer: WebGPURenderer
|
|
61
|
+
WebGPURenderer: WebGPURenderer,
|
|
62
|
+
loadInspector: loadInspector
|
|
63
63
|
}, [THREE$1]);
|
|
64
64
|
|
|
65
65
|
//* Utility Types ==============================
|
|
@@ -497,6 +497,18 @@ interface InternalState {
|
|
|
497
497
|
* @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
|
|
498
498
|
*/
|
|
499
499
|
canvasTarget?: CanvasTarget
|
|
500
|
+
/**
|
|
501
|
+
* Set when this root's canvas target has been resized and the backend's cached render pass
|
|
502
|
+
* descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
|
|
503
|
+
*
|
|
504
|
+
* Flushed by the canvas-target job in the `start` phase, which is the only place this root's
|
|
505
|
+
* target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
|
|
506
|
+
* whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
|
|
507
|
+
* invalidate some other canvas's descriptor instead.
|
|
508
|
+
*
|
|
509
|
+
* @see https://github.com/pmndrs/react-three-fiber/issues/3847
|
|
510
|
+
*/
|
|
511
|
+
canvasTargetSizeDirty?: boolean
|
|
500
512
|
/**
|
|
501
513
|
* Whether multi-canvas rendering is active.
|
|
502
514
|
* True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
|
|
@@ -706,12 +718,19 @@ type DefaultRendererProps = {
|
|
|
706
718
|
*/
|
|
707
719
|
interface CanvasSchedulerConfig {
|
|
708
720
|
/**
|
|
709
|
-
*
|
|
710
|
-
|
|
721
|
+
* Run this Canvas root before the referenced Canvas root id(s).
|
|
722
|
+
*/
|
|
723
|
+
before?: string | string[]
|
|
724
|
+
/**
|
|
725
|
+
* Run this Canvas root after the referenced Canvas root id(s).
|
|
726
|
+
*/
|
|
727
|
+
after?: string | string[]
|
|
728
|
+
/**
|
|
729
|
+
* Numeric root order. Lower values run first.
|
|
711
730
|
*/
|
|
712
|
-
|
|
731
|
+
order?: number
|
|
713
732
|
/**
|
|
714
|
-
* Limit this
|
|
733
|
+
* Limit this Canvas's default render job (frames per second).
|
|
715
734
|
*/
|
|
716
735
|
fps?: number
|
|
717
736
|
}
|
|
@@ -1315,11 +1334,16 @@ declare global {
|
|
|
1315
1334
|
/** Pass record - stores TSL pass nodes for render pipeline */
|
|
1316
1335
|
type PassRecord = Record<string, any>
|
|
1317
1336
|
|
|
1337
|
+
/** State passed to pipeline callbacks after the active pipeline has been created */
|
|
1338
|
+
type RenderPipelineCallbackState = RootState & {
|
|
1339
|
+
renderPipeline: ThreeRenderPipeline
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1318
1342
|
/** Setup callback - runs first to configure MRT, create additional passes */
|
|
1319
|
-
type RenderPipelineSetupCallback = (state:
|
|
1343
|
+
type RenderPipelineSetupCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1320
1344
|
|
|
1321
1345
|
/** Main callback - runs second to configure outputNode, create effect passes */
|
|
1322
|
-
type RenderPipelineMainCallback = (state:
|
|
1346
|
+
type RenderPipelineMainCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1323
1347
|
|
|
1324
1348
|
/** Return type for useRenderPipeline hook */
|
|
1325
1349
|
interface UseRenderPipelineReturn {
|
|
@@ -1635,9 +1659,9 @@ type EnvironmentProps = {
|
|
|
1635
1659
|
blur?: number;
|
|
1636
1660
|
backgroundBlurriness?: number;
|
|
1637
1661
|
backgroundIntensity?: number;
|
|
1638
|
-
backgroundRotation?: Euler
|
|
1662
|
+
backgroundRotation?: Euler;
|
|
1639
1663
|
environmentIntensity?: number;
|
|
1640
|
-
environmentRotation?: Euler
|
|
1664
|
+
environmentRotation?: Euler;
|
|
1641
1665
|
map?: Texture$1;
|
|
1642
1666
|
preset?: PresetsType;
|
|
1643
1667
|
scene?: Scene | React$1.RefObject<Scene>;
|
|
@@ -1721,7 +1745,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
1721
1745
|
declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1722
1746
|
declare module '@react-three/fiber' {
|
|
1723
1747
|
interface ThreeElements {
|
|
1724
|
-
groundProjectedEnvImpl: ThreeElement
|
|
1748
|
+
groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
|
|
1725
1749
|
}
|
|
1726
1750
|
}
|
|
1727
1751
|
/**
|
|
@@ -1879,7 +1903,7 @@ declare namespace useLoader {
|
|
|
1879
1903
|
*
|
|
1880
1904
|
* @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
|
|
1881
1905
|
* @param priorityOrOptions - Either a priority number (backwards compat) or options object
|
|
1882
|
-
* @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
|
|
1906
|
+
* @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
|
|
1883
1907
|
*
|
|
1884
1908
|
* @example
|
|
1885
1909
|
* // Simple priority (backwards compat)
|
|
@@ -2175,7 +2199,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
|
|
|
2175
2199
|
* Invalidates the view, requesting a frame to be rendered.
|
|
2176
2200
|
* In demand mode, this triggers the scheduler to run frames.
|
|
2177
2201
|
*
|
|
2178
|
-
*
|
|
2202
|
+
* With a state argument, only that root's jobs run on the requested frames; other
|
|
2203
|
+
* roots on 'demand' stay idle. Without one, every registered root is invalidated.
|
|
2204
|
+
*
|
|
2205
|
+
* @param state - Optional root state; targets the invalidation at that root
|
|
2179
2206
|
* @param frames - Number of frames to request (default: 1)
|
|
2180
2207
|
* @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
|
|
2181
2208
|
*
|
|
@@ -2186,14 +2213,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
|
|
|
2186
2213
|
* Advances the frameloop and runs render effects.
|
|
2187
2214
|
* Useful for when manually rendering via `frameloop="never"`.
|
|
2188
2215
|
*
|
|
2216
|
+
* With a state argument, only that root is stepped. Without one, every
|
|
2217
|
+
* registered root is stepped for backwards compatibility.
|
|
2218
|
+
*
|
|
2189
2219
|
* @param timestamp - The timestamp to use for this frame
|
|
2190
2220
|
* @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
|
|
2191
|
-
* @param state -
|
|
2192
|
-
* @param frame - Ignored (kept for backwards compat)
|
|
2221
|
+
* @param state - Optional root state; targets the manual step at that root
|
|
2193
2222
|
*
|
|
2194
2223
|
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
2195
2224
|
*/
|
|
2196
|
-
declare function advance(timestamp: number): void;
|
|
2225
|
+
declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
|
|
2197
2226
|
|
|
2198
2227
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2199
2228
|
declare function ReactReconciler<
|