@motion-core/motion-gpu 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -1
- package/dist/core/pointer.d.ts +96 -0
- package/dist/core/pointer.d.ts.map +1 -0
- package/dist/core/pointer.js +71 -0
- package/dist/core/pointer.js.map +1 -0
- package/dist/motion-gpu.css +295 -0
- package/dist/react/advanced.js +2 -1
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +2 -1
- package/dist/react/use-pointer.d.ts +94 -0
- package/dist/react/use-pointer.d.ts.map +1 -0
- package/dist/react/use-pointer.js +285 -0
- package/dist/react/use-pointer.js.map +1 -0
- package/dist/svelte/advanced.js +2 -1
- package/dist/svelte/index.d.ts +2 -0
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +2 -1
- package/dist/svelte/use-pointer.d.ts +94 -0
- package/dist/svelte/use-pointer.d.ts.map +1 -0
- package/dist/svelte/use-pointer.js +292 -0
- package/dist/svelte/use-pointer.js.map +1 -0
- package/dist/vue/FragCanvas.js +8 -0
- package/dist/vue/FragCanvas.js.map +1 -0
- package/dist/vue/FragCanvas.vue.d.ts +49 -0
- package/dist/vue/FragCanvas.vue.d.ts.map +1 -0
- package/dist/vue/FragCanvas.vue_vue_type_script_setup_true_lang.js +228 -0
- package/dist/vue/FragCanvas.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/MotionGPUErrorOverlay.js +8 -0
- package/dist/vue/MotionGPUErrorOverlay.js.map +1 -0
- package/dist/vue/MotionGPUErrorOverlay.vue.d.ts +8 -0
- package/dist/vue/MotionGPUErrorOverlay.vue.d.ts.map +1 -0
- package/dist/vue/MotionGPUErrorOverlay.vue_vue_type_script_setup_true_lang.js +166 -0
- package/dist/vue/MotionGPUErrorOverlay.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/Portal.js +7 -0
- package/dist/vue/Portal.js.map +1 -0
- package/dist/vue/Portal.vue.d.ts +18 -0
- package/dist/vue/Portal.vue.d.ts.map +1 -0
- package/dist/vue/Portal.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/vue/Portal.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/vue/advanced.d.ts +12 -0
- package/dist/vue/advanced.d.ts.map +1 -0
- package/dist/vue/advanced.js +15 -0
- package/dist/vue/frame-context.d.ts +22 -0
- package/dist/vue/frame-context.d.ts.map +1 -0
- package/dist/vue/frame-context.js +38 -0
- package/dist/vue/frame-context.js.map +1 -0
- package/dist/vue/index.d.ts +21 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/index.js +14 -0
- package/dist/vue/motiongpu-context.d.ts +81 -0
- package/dist/vue/motiongpu-context.d.ts.map +1 -0
- package/dist/vue/motiongpu-context.js +29 -0
- package/dist/vue/motiongpu-context.js.map +1 -0
- package/dist/vue/shims-vue.d.js +0 -0
- package/dist/vue/use-motiongpu-user-context.d.ts +44 -0
- package/dist/vue/use-motiongpu-user-context.d.ts.map +1 -0
- package/dist/vue/use-motiongpu-user-context.js +76 -0
- package/dist/vue/use-motiongpu-user-context.js.map +1 -0
- package/dist/vue/use-pointer.d.ts +94 -0
- package/dist/vue/use-pointer.d.ts.map +1 -0
- package/dist/vue/use-pointer.js +298 -0
- package/dist/vue/use-pointer.js.map +1 -0
- package/dist/vue/use-texture.d.ts +45 -0
- package/dist/vue/use-texture.d.ts.map +1 -0
- package/dist/vue/use-texture.js +135 -0
- package/dist/vue/use-texture.js.map +1 -0
- package/package.json +25 -7
- package/src/lib/core/pointer.ts +177 -0
- package/src/lib/react/index.ts +10 -0
- package/src/lib/react/use-pointer.ts +515 -0
- package/src/lib/svelte/index.ts +10 -0
- package/src/lib/svelte/use-pointer.ts +507 -0
- package/src/lib/vue/FragCanvas.vue +294 -0
- package/src/lib/vue/MotionGPUErrorOverlay.vue +518 -0
- package/src/lib/vue/Portal.vue +46 -0
- package/src/lib/vue/advanced.ts +32 -0
- package/src/lib/vue/frame-context.ts +96 -0
- package/src/lib/vue/index.ts +78 -0
- package/src/lib/vue/motiongpu-context.ts +97 -0
- package/src/lib/vue/shims-vue.d.ts +6 -0
- package/src/lib/vue/use-motiongpu-user-context.ts +145 -0
- package/src/lib/vue/use-pointer.ts +514 -0
- package/src/lib/vue/use-texture.ts +232 -0
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[](https://opensource.org/licenses/MIT)
|
|
4
4
|
[](https://svelte.dev)
|
|
5
5
|
[](https://react.dev)
|
|
6
|
+
[](https://vuejs.org)
|
|
6
7
|
[](https://gpuweb.github.io/gpuweb/)
|
|
7
8
|
[](https://www.typescriptlang.org)
|
|
8
9
|
[](https://www.npmjs.com/package/@motion-core/motion-gpu)
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
|
|
14
15
|
**A tiny WebGPU runtime for writing Shadertoy-style fullscreen shaders in pure WGSL.**
|
|
15
16
|
|
|
16
|
-
`@motion-core/motion-gpu` ships a framework-agnostic core plus Svelte 5 and
|
|
17
|
+
`@motion-core/motion-gpu` ships a framework-agnostic core plus Svelte 5, React, and Vue adapters for building fullscreen shader pipelines using WebGPU and WGSL.
|
|
17
18
|
It provides a minimal runtime loop, scheduler, and render graph designed specifically for fragment-driven GPU programs.
|
|
18
19
|
|
|
19
20
|
Unlike general-purpose 3D engines, Motion GPU focuses on a very narrow problem: **running fullscreen fragment shaders and multi-pass GPU pipelines**.
|
|
@@ -100,6 +101,7 @@ Motion GPU follows a simple three-step flow:
|
|
|
100
101
|
- `defineMaterial`
|
|
101
102
|
- `useMotionGPU`
|
|
102
103
|
- `useFrame`
|
|
104
|
+
- `usePointer`
|
|
103
105
|
- `useTexture`
|
|
104
106
|
- `ShaderPass`
|
|
105
107
|
- `BlitPass`
|
|
@@ -134,6 +136,7 @@ Also exports runtime/core types:
|
|
|
134
136
|
- `defineMaterial`
|
|
135
137
|
- `useMotionGPU`
|
|
136
138
|
- `useFrame`
|
|
139
|
+
- `usePointer`
|
|
137
140
|
- `useTexture`
|
|
138
141
|
- `ShaderPass`
|
|
139
142
|
- `BlitPass`
|
|
@@ -161,6 +164,41 @@ Also exports runtime/core types:
|
|
|
161
164
|
|
|
162
165
|
---
|
|
163
166
|
|
|
167
|
+
## Vue adapter
|
|
168
|
+
|
|
169
|
+
`@motion-core/motion-gpu/vue` exposes the runtime API for Vue:
|
|
170
|
+
|
|
171
|
+
- `FragCanvas`
|
|
172
|
+
- `defineMaterial`
|
|
173
|
+
- `useMotionGPU`
|
|
174
|
+
- `useFrame`
|
|
175
|
+
- `usePointer`
|
|
176
|
+
- `useTexture`
|
|
177
|
+
- `ShaderPass`
|
|
178
|
+
- `BlitPass`
|
|
179
|
+
- `CopyPass`
|
|
180
|
+
- `ComputePass`
|
|
181
|
+
- `PingPongComputePass`
|
|
182
|
+
|
|
183
|
+
Also exports runtime/core types:
|
|
184
|
+
|
|
185
|
+
- uniforms
|
|
186
|
+
- textures
|
|
187
|
+
- render passes
|
|
188
|
+
- scheduler
|
|
189
|
+
- loader types
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
`@motion-core/motion-gpu/vue/advanced` re-exports everything above, plus:
|
|
194
|
+
|
|
195
|
+
- `useMotionGPUUserContext`
|
|
196
|
+
- `setMotionGPUUserContext`
|
|
197
|
+
- `applySchedulerPreset`
|
|
198
|
+
- `captureSchedulerDebugSnapshot`
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
164
202
|
## Framework-agnostic core
|
|
165
203
|
|
|
166
204
|
`@motion-core/motion-gpu` (and explicit alias `@motion-core/motion-gpu/core`) exposes adapter-building primitives:
|
|
@@ -189,6 +227,7 @@ Also exports runtime/core types:
|
|
|
189
227
|
|
|
190
228
|
- Svelte 5 is required only for the Svelte adapter entrypoints (`/svelte`, `/svelte/advanced`)
|
|
191
229
|
- React 18+ is required only for the React adapter entrypoints (`/react`, `/react/advanced`)
|
|
230
|
+
- Vue 3.5+ is required only for the Vue adapter entrypoints (`/vue`, `/vue/advanced`)
|
|
192
231
|
- A browser/runtime with WebGPU support
|
|
193
232
|
- Secure context (`https://` or `localhost`)
|
|
194
233
|
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { RenderMode } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Pointer kind normalized from DOM `PointerEvent.pointerType`.
|
|
4
|
+
*/
|
|
5
|
+
export type PointerKind = 'mouse' | 'pen' | 'touch';
|
|
6
|
+
/**
|
|
7
|
+
* 2D tuple used by pointer coordinate payloads.
|
|
8
|
+
*/
|
|
9
|
+
export type PointerVec2 = [number, number];
|
|
10
|
+
/**
|
|
11
|
+
* Normalized pointer coordinates exposed to runtime hooks.
|
|
12
|
+
*/
|
|
13
|
+
export interface PointerPoint {
|
|
14
|
+
/**
|
|
15
|
+
* CSS pixel coordinates relative to canvas top-left corner.
|
|
16
|
+
*/
|
|
17
|
+
px: PointerVec2;
|
|
18
|
+
/**
|
|
19
|
+
* UV coordinates in shader-friendly orientation (`y` grows upward).
|
|
20
|
+
*/
|
|
21
|
+
uv: PointerVec2;
|
|
22
|
+
/**
|
|
23
|
+
* Normalized device coordinates (`-1..1`, `y` grows upward).
|
|
24
|
+
*/
|
|
25
|
+
ndc: PointerVec2;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Mutable pointer state snapshot exposed by `usePointer`.
|
|
29
|
+
*/
|
|
30
|
+
export interface PointerState extends PointerPoint {
|
|
31
|
+
inside: boolean;
|
|
32
|
+
pressed: boolean;
|
|
33
|
+
dragging: boolean;
|
|
34
|
+
pointerType: PointerKind | null;
|
|
35
|
+
pointerId: number | null;
|
|
36
|
+
button: number | null;
|
|
37
|
+
buttons: number;
|
|
38
|
+
time: number;
|
|
39
|
+
downPx: PointerVec2 | null;
|
|
40
|
+
downUv: PointerVec2 | null;
|
|
41
|
+
deltaPx: PointerVec2;
|
|
42
|
+
deltaUv: PointerVec2;
|
|
43
|
+
velocityPx: PointerVec2;
|
|
44
|
+
velocityUv: PointerVec2;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Modifier key snapshot attached to pointer click events.
|
|
48
|
+
*/
|
|
49
|
+
export interface PointerModifiers {
|
|
50
|
+
alt: boolean;
|
|
51
|
+
ctrl: boolean;
|
|
52
|
+
shift: boolean;
|
|
53
|
+
meta: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Click/tap payload produced by `usePointer`.
|
|
57
|
+
*/
|
|
58
|
+
export interface PointerClick extends PointerPoint {
|
|
59
|
+
id: number;
|
|
60
|
+
time: number;
|
|
61
|
+
pointerType: PointerKind;
|
|
62
|
+
pointerId: number;
|
|
63
|
+
button: number;
|
|
64
|
+
modifiers: PointerModifiers;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Frame wake-up strategy for pointer-driven interactions.
|
|
68
|
+
*/
|
|
69
|
+
export type PointerFrameRequestMode = 'advance' | 'auto' | 'invalidate' | 'none';
|
|
70
|
+
/**
|
|
71
|
+
* Returns a monotonic timestamp in seconds.
|
|
72
|
+
*/
|
|
73
|
+
export declare function getPointerNowSeconds(): number;
|
|
74
|
+
/**
|
|
75
|
+
* Creates the initial pointer state snapshot.
|
|
76
|
+
*/
|
|
77
|
+
export declare function createInitialPointerState(): PointerState;
|
|
78
|
+
/**
|
|
79
|
+
* Normalized coordinate payload for a pointer position against a canvas rect.
|
|
80
|
+
*/
|
|
81
|
+
export interface PointerCoordinates extends PointerPoint {
|
|
82
|
+
inside: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Converts client coordinates to canvas-relative pointer coordinates.
|
|
86
|
+
*/
|
|
87
|
+
export declare function getPointerCoordinates(clientX: number, clientY: number, rect: Pick<DOMRectReadOnly, 'height' | 'left' | 'top' | 'width'>): PointerCoordinates;
|
|
88
|
+
/**
|
|
89
|
+
* Resolves frame wake-up strategy for pointer-driven updates.
|
|
90
|
+
*/
|
|
91
|
+
export declare function resolvePointerFrameRequestMode(mode: PointerFrameRequestMode, renderMode: RenderMode): Exclude<PointerFrameRequestMode, 'auto'>;
|
|
92
|
+
/**
|
|
93
|
+
* Normalizes unknown pointer kind values to the public `PointerKind`.
|
|
94
|
+
*/
|
|
95
|
+
export declare function normalizePointerKind(pointerType: string): PointerKind;
|
|
96
|
+
//# sourceMappingURL=pointer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointer.d.ts","sourceRoot":"","sources":["../../src/lib/core/pointer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,EAAE,EAAE,WAAW,CAAC;IAChB;;OAEG;IACH,EAAE,EAAE,WAAW,CAAC;IAChB;;OAEG;IACH,GAAG,EAAE,WAAW,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,YAAY;IACjD,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,WAA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2
|
+
/**
|
|
3
|
+
* Returns a monotonic timestamp in seconds.
|
|
4
|
+
*/
|
|
5
|
+
function getPointerNowSeconds() {
|
|
6
|
+
if (typeof performance !== "undefined" && typeof performance.now === "function") return performance.now() / 1e3;
|
|
7
|
+
return Date.now() / 1e3;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates the initial pointer state snapshot.
|
|
11
|
+
*/
|
|
12
|
+
function createInitialPointerState() {
|
|
13
|
+
return {
|
|
14
|
+
px: [0, 0],
|
|
15
|
+
uv: [0, 0],
|
|
16
|
+
ndc: [-1, -1],
|
|
17
|
+
inside: false,
|
|
18
|
+
pressed: false,
|
|
19
|
+
dragging: false,
|
|
20
|
+
pointerType: null,
|
|
21
|
+
pointerId: null,
|
|
22
|
+
button: null,
|
|
23
|
+
buttons: 0,
|
|
24
|
+
time: getPointerNowSeconds(),
|
|
25
|
+
downPx: null,
|
|
26
|
+
downUv: null,
|
|
27
|
+
deltaPx: [0, 0],
|
|
28
|
+
deltaUv: [0, 0],
|
|
29
|
+
velocityPx: [0, 0],
|
|
30
|
+
velocityUv: [0, 0]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Converts client coordinates to canvas-relative pointer coordinates.
|
|
35
|
+
*/
|
|
36
|
+
function getPointerCoordinates(clientX, clientY, rect) {
|
|
37
|
+
const width = Math.max(rect.width, 1);
|
|
38
|
+
const height = Math.max(rect.height, 1);
|
|
39
|
+
const nx = (clientX - rect.left) / width;
|
|
40
|
+
const ny = (clientY - rect.top) / height;
|
|
41
|
+
const pxX = clientX - rect.left;
|
|
42
|
+
const pxY = clientY - rect.top;
|
|
43
|
+
const uvX = nx;
|
|
44
|
+
const uvY = 1 - ny;
|
|
45
|
+
return {
|
|
46
|
+
px: [pxX, pxY],
|
|
47
|
+
uv: [uvX, uvY],
|
|
48
|
+
ndc: [nx * 2 - 1, uvY * 2 - 1],
|
|
49
|
+
inside: nx >= 0 && nx <= 1 && ny >= 0 && ny <= 1
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolves frame wake-up strategy for pointer-driven updates.
|
|
54
|
+
*/
|
|
55
|
+
function resolvePointerFrameRequestMode(mode, renderMode) {
|
|
56
|
+
if (mode !== "auto") return mode;
|
|
57
|
+
if (renderMode === "manual") return "advance";
|
|
58
|
+
if (renderMode === "on-demand") return "invalidate";
|
|
59
|
+
return "none";
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Normalizes unknown pointer kind values to the public `PointerKind`.
|
|
63
|
+
*/
|
|
64
|
+
function normalizePointerKind(pointerType) {
|
|
65
|
+
if (pointerType === "mouse" || pointerType === "pen" || pointerType === "touch") return pointerType;
|
|
66
|
+
return "mouse";
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { createInitialPointerState, getPointerCoordinates, getPointerNowSeconds, normalizePointerKind, resolvePointerFrameRequestMode };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=pointer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointer.js","names":[],"sources":["../../src/lib/core/pointer.ts"],"sourcesContent":["import type { RenderMode } from './types.js';\n\n/**\n * Pointer kind normalized from DOM `PointerEvent.pointerType`.\n */\nexport type PointerKind = 'mouse' | 'pen' | 'touch';\n\n/**\n * 2D tuple used by pointer coordinate payloads.\n */\nexport type PointerVec2 = [number, number];\n\n/**\n * Normalized pointer coordinates exposed to runtime hooks.\n */\nexport interface PointerPoint {\n\t/**\n\t * CSS pixel coordinates relative to canvas top-left corner.\n\t */\n\tpx: PointerVec2;\n\t/**\n\t * UV coordinates in shader-friendly orientation (`y` grows upward).\n\t */\n\tuv: PointerVec2;\n\t/**\n\t * Normalized device coordinates (`-1..1`, `y` grows upward).\n\t */\n\tndc: PointerVec2;\n}\n\n/**\n * Mutable pointer state snapshot exposed by `usePointer`.\n */\nexport interface PointerState extends PointerPoint {\n\tinside: boolean;\n\tpressed: boolean;\n\tdragging: boolean;\n\tpointerType: PointerKind | null;\n\tpointerId: number | null;\n\tbutton: number | null;\n\tbuttons: number;\n\ttime: number;\n\tdownPx: PointerVec2 | null;\n\tdownUv: PointerVec2 | null;\n\tdeltaPx: PointerVec2;\n\tdeltaUv: PointerVec2;\n\tvelocityPx: PointerVec2;\n\tvelocityUv: PointerVec2;\n}\n\n/**\n * Modifier key snapshot attached to pointer click events.\n */\nexport interface PointerModifiers {\n\talt: boolean;\n\tctrl: boolean;\n\tshift: boolean;\n\tmeta: boolean;\n}\n\n/**\n * Click/tap payload produced by `usePointer`.\n */\nexport interface PointerClick extends PointerPoint {\n\tid: number;\n\ttime: number;\n\tpointerType: PointerKind;\n\tpointerId: number;\n\tbutton: number;\n\tmodifiers: PointerModifiers;\n}\n\n/**\n * Frame wake-up strategy for pointer-driven interactions.\n */\nexport type PointerFrameRequestMode = 'advance' | 'auto' | 'invalidate' | 'none';\n\n/**\n * Returns a monotonic timestamp in seconds.\n */\nexport function getPointerNowSeconds(): number {\n\tif (typeof performance !== 'undefined' && typeof performance.now === 'function') {\n\t\treturn performance.now() / 1000;\n\t}\n\n\treturn Date.now() / 1000;\n}\n\n/**\n * Creates the initial pointer state snapshot.\n */\nexport function createInitialPointerState(): PointerState {\n\treturn {\n\t\tpx: [0, 0],\n\t\tuv: [0, 0],\n\t\tndc: [-1, -1],\n\t\tinside: false,\n\t\tpressed: false,\n\t\tdragging: false,\n\t\tpointerType: null,\n\t\tpointerId: null,\n\t\tbutton: null,\n\t\tbuttons: 0,\n\t\ttime: getPointerNowSeconds(),\n\t\tdownPx: null,\n\t\tdownUv: null,\n\t\tdeltaPx: [0, 0],\n\t\tdeltaUv: [0, 0],\n\t\tvelocityPx: [0, 0],\n\t\tvelocityUv: [0, 0]\n\t};\n}\n\n/**\n * Normalized coordinate payload for a pointer position against a canvas rect.\n */\nexport interface PointerCoordinates extends PointerPoint {\n\tinside: boolean;\n}\n\n/**\n * Converts client coordinates to canvas-relative pointer coordinates.\n */\nexport function getPointerCoordinates(\n\tclientX: number,\n\tclientY: number,\n\trect: Pick<DOMRectReadOnly, 'height' | 'left' | 'top' | 'width'>\n): PointerCoordinates {\n\tconst width = Math.max(rect.width, 1);\n\tconst height = Math.max(rect.height, 1);\n\tconst nx = (clientX - rect.left) / width;\n\tconst ny = (clientY - rect.top) / height;\n\tconst pxX = clientX - rect.left;\n\tconst pxY = clientY - rect.top;\n\tconst uvX = nx;\n\tconst uvY = 1 - ny;\n\n\treturn {\n\t\tpx: [pxX, pxY],\n\t\tuv: [uvX, uvY],\n\t\tndc: [nx * 2 - 1, uvY * 2 - 1],\n\t\tinside: nx >= 0 && nx <= 1 && ny >= 0 && ny <= 1\n\t};\n}\n\n/**\n * Resolves frame wake-up strategy for pointer-driven updates.\n */\nexport function resolvePointerFrameRequestMode(\n\tmode: PointerFrameRequestMode,\n\trenderMode: RenderMode\n): Exclude<PointerFrameRequestMode, 'auto'> {\n\tif (mode !== 'auto') {\n\t\treturn mode;\n\t}\n\n\tif (renderMode === 'manual') {\n\t\treturn 'advance';\n\t}\n\n\tif (renderMode === 'on-demand') {\n\t\treturn 'invalidate';\n\t}\n\n\treturn 'none';\n}\n\n/**\n * Normalizes unknown pointer kind values to the public `PointerKind`.\n */\nexport function normalizePointerKind(pointerType: string): PointerKind {\n\tif (pointerType === 'mouse' || pointerType === 'pen' || pointerType === 'touch') {\n\t\treturn pointerType;\n\t}\n\n\treturn 'mouse';\n}\n"],"mappings":";;;;AAgFA,SAAgB,uBAA+B;AAC9C,KAAI,OAAO,gBAAgB,eAAe,OAAO,YAAY,QAAQ,WACpE,QAAO,YAAY,KAAK,GAAG;AAG5B,QAAO,KAAK,KAAK,GAAG;;;;;AAMrB,SAAgB,4BAA0C;AACzD,QAAO;EACN,IAAI,CAAC,GAAG,EAAE;EACV,IAAI,CAAC,GAAG,EAAE;EACV,KAAK,CAAC,IAAI,GAAG;EACb,QAAQ;EACR,SAAS;EACT,UAAU;EACV,aAAa;EACb,WAAW;EACX,QAAQ;EACR,SAAS;EACT,MAAM,sBAAsB;EAC5B,QAAQ;EACR,QAAQ;EACR,SAAS,CAAC,GAAG,EAAE;EACf,SAAS,CAAC,GAAG,EAAE;EACf,YAAY,CAAC,GAAG,EAAE;EAClB,YAAY,CAAC,GAAG,EAAE;EAClB;;;;;AAaF,SAAgB,sBACf,SACA,SACA,MACqB;CACrB,MAAM,QAAQ,KAAK,IAAI,KAAK,OAAO,EAAE;CACrC,MAAM,SAAS,KAAK,IAAI,KAAK,QAAQ,EAAE;CACvC,MAAM,MAAM,UAAU,KAAK,QAAQ;CACnC,MAAM,MAAM,UAAU,KAAK,OAAO;CAClC,MAAM,MAAM,UAAU,KAAK;CAC3B,MAAM,MAAM,UAAU,KAAK;CAC3B,MAAM,MAAM;CACZ,MAAM,MAAM,IAAI;AAEhB,QAAO;EACN,IAAI,CAAC,KAAK,IAAI;EACd,IAAI,CAAC,KAAK,IAAI;EACd,KAAK,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,EAAE;EAC9B,QAAQ,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM;EAC/C;;;;;AAMF,SAAgB,+BACf,MACA,YAC2C;AAC3C,KAAI,SAAS,OACZ,QAAO;AAGR,KAAI,eAAe,SAClB,QAAO;AAGR,KAAI,eAAe,YAClB,QAAO;AAGR,QAAO;;;;;AAMR,SAAgB,qBAAqB,aAAkC;AACtE,KAAI,gBAAgB,WAAW,gBAAgB,SAAS,gBAAgB,QACvE,QAAO;AAGR,QAAO"}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
|
|
2
|
+
.motiongpu-error-overlay {
|
|
3
|
+
--motiongpu-base-hue: var(--base-hue, 265);
|
|
4
|
+
--motiongpu-color-background: oklch(0.2178 0.0056 var(--motiongpu-base-hue));
|
|
5
|
+
--motiongpu-color-background-muted: oklch(0.261 0.007 var(--motiongpu-base-hue));
|
|
6
|
+
--motiongpu-color-foreground: oklch(1 0 0);
|
|
7
|
+
--motiongpu-color-foreground-muted: oklch(0.6699 0.0081 var(--motiongpu-base-hue));
|
|
8
|
+
--motiongpu-color-card: var(--motiongpu-color-background);
|
|
9
|
+
--motiongpu-color-accent: oklch(0.6996 0.181959 44.4414);
|
|
10
|
+
--motiongpu-color-accent-secondary: oklch(0.5096 0.131959 44.4414);
|
|
11
|
+
--motiongpu-color-border: oklch(0.928 0.013 var(--motiongpu-base-hue) / 0.05);
|
|
12
|
+
--motiongpu-color-white-fixed: oklch(1 0 0);
|
|
13
|
+
--motiongpu-shadow-card: var(
|
|
14
|
+
--shadow-2xl,
|
|
15
|
+
0px 1px 1px -0.5px rgba(0, 0, 0, 0.06),
|
|
16
|
+
0px 3px 3px -1.5px rgba(0, 0, 0, 0.06),
|
|
17
|
+
0px 6px 6px -3px rgba(0, 0, 0, 0.06),
|
|
18
|
+
0px 12px 12px -6px rgba(0, 0, 0, 0.06),
|
|
19
|
+
0px 24px 24px -12px rgba(0, 0, 0, 0.05),
|
|
20
|
+
0px 48px 48px -24px rgba(0, 0, 0, 0.06)
|
|
21
|
+
);
|
|
22
|
+
--motiongpu-radius-md: var(--radius-md, 0.5rem);
|
|
23
|
+
--motiongpu-radius-lg: var(--radius-lg, 0.75rem);
|
|
24
|
+
--motiongpu-radius-xl: var(--radius-xl, 1rem);
|
|
25
|
+
--motiongpu-font-sans: var(--font-sans, 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif);
|
|
26
|
+
--motiongpu-font-mono: var(--font-mono, 'SFMono-Regular', 'Menlo', 'Consolas', monospace);
|
|
27
|
+
position: fixed;
|
|
28
|
+
inset: 0;
|
|
29
|
+
display: grid;
|
|
30
|
+
place-items: center;
|
|
31
|
+
padding: clamp(0.75rem, 1.4vw, 1.5rem);
|
|
32
|
+
background: rgba(0, 0, 0, 0.8);
|
|
33
|
+
backdrop-filter: blur(10px);
|
|
34
|
+
z-index: 2147483647;
|
|
35
|
+
font-family: var(--motiongpu-font-sans);
|
|
36
|
+
color-scheme: dark;
|
|
37
|
+
}
|
|
38
|
+
.motiongpu-error-dialog {
|
|
39
|
+
width: min(52rem, calc(100vw - 1.5rem));
|
|
40
|
+
max-height: min(84vh, 44rem);
|
|
41
|
+
overflow: auto;
|
|
42
|
+
margin: 0;
|
|
43
|
+
padding: 1.1rem;
|
|
44
|
+
border: 1px solid var(--motiongpu-color-border);
|
|
45
|
+
border-radius: var(--motiongpu-radius-xl);
|
|
46
|
+
max-width: calc(100vw - 1.5rem);
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
font-size: 0.875rem;
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
line-height: 1.45;
|
|
51
|
+
background: var(--motiongpu-color-card);
|
|
52
|
+
color: var(--motiongpu-color-foreground);
|
|
53
|
+
box-shadow: var(--motiongpu-shadow-card);
|
|
54
|
+
}
|
|
55
|
+
.motiongpu-error-header {
|
|
56
|
+
display: grid;
|
|
57
|
+
gap: 0.55rem;
|
|
58
|
+
padding-bottom: 0.9rem;
|
|
59
|
+
border-bottom: 1px solid var(--motiongpu-color-border);
|
|
60
|
+
}
|
|
61
|
+
.motiongpu-error-header-top {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: flex-start;
|
|
64
|
+
gap: 0.75rem;
|
|
65
|
+
}
|
|
66
|
+
.motiongpu-error-badges {
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 0.4rem;
|
|
70
|
+
flex-wrap: wrap;
|
|
71
|
+
}
|
|
72
|
+
.motiongpu-error-badge-wrap {
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 0.4rem;
|
|
76
|
+
width: fit-content;
|
|
77
|
+
padding: 0.18rem;
|
|
78
|
+
border-radius: 999px;
|
|
79
|
+
border: 1px solid var(--motiongpu-color-border);
|
|
80
|
+
background: var(--motiongpu-color-background-muted);
|
|
81
|
+
}
|
|
82
|
+
.motiongpu-error-badge {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
margin: 0;
|
|
86
|
+
padding: 0.22rem 0.56rem;
|
|
87
|
+
border-radius: 999px;
|
|
88
|
+
font-size: 0.66rem;
|
|
89
|
+
letter-spacing: 0.08em;
|
|
90
|
+
line-height: 1;
|
|
91
|
+
font-weight: 500;
|
|
92
|
+
text-transform: uppercase;
|
|
93
|
+
color: var(--motiongpu-color-white-fixed);
|
|
94
|
+
background: linear-gradient(
|
|
95
|
+
180deg,
|
|
96
|
+
var(--motiongpu-color-accent) 0%,
|
|
97
|
+
var(--motiongpu-color-accent-secondary) 100%
|
|
98
|
+
);
|
|
99
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
|
|
100
|
+
}
|
|
101
|
+
.motiongpu-error-recoverable {
|
|
102
|
+
margin: 0;
|
|
103
|
+
font-size: 0.67rem;
|
|
104
|
+
line-height: 1.2;
|
|
105
|
+
letter-spacing: 0.06em;
|
|
106
|
+
text-transform: uppercase;
|
|
107
|
+
color: var(--motiongpu-color-foreground-muted);
|
|
108
|
+
}
|
|
109
|
+
.motiongpu-error-recoverable span {
|
|
110
|
+
font-family: var(--motiongpu-font-mono);
|
|
111
|
+
color: var(--motiongpu-color-foreground);
|
|
112
|
+
}
|
|
113
|
+
.motiongpu-error-title {
|
|
114
|
+
margin: 0;
|
|
115
|
+
font-size: clamp(1.02rem, 1vw + 0.72rem, 1.32rem);
|
|
116
|
+
font-weight: 500;
|
|
117
|
+
line-height: 1.18;
|
|
118
|
+
letter-spacing: -0.02em;
|
|
119
|
+
text-wrap: balance;
|
|
120
|
+
color: var(--motiongpu-color-foreground);
|
|
121
|
+
}
|
|
122
|
+
.motiongpu-error-body {
|
|
123
|
+
display: grid;
|
|
124
|
+
gap: 0.62rem;
|
|
125
|
+
margin-top: 0.92rem;
|
|
126
|
+
}
|
|
127
|
+
.motiongpu-error-message {
|
|
128
|
+
margin: 0;
|
|
129
|
+
padding: 0.72rem 0.78rem;
|
|
130
|
+
border: 1px solid color-mix(in oklch, var(--motiongpu-color-accent) 28%, transparent);
|
|
131
|
+
border-radius: var(--motiongpu-radius-md);
|
|
132
|
+
background: color-mix(in oklch, var(--motiongpu-color-accent) 10%, transparent);
|
|
133
|
+
font-size: 0.82rem;
|
|
134
|
+
line-height: 1.4;
|
|
135
|
+
font-weight: 400;
|
|
136
|
+
color: var(--motiongpu-color-foreground);
|
|
137
|
+
}
|
|
138
|
+
.motiongpu-error-hint {
|
|
139
|
+
margin: 0;
|
|
140
|
+
font-size: 0.82rem;
|
|
141
|
+
line-height: 1.45;
|
|
142
|
+
font-weight: 400;
|
|
143
|
+
color: var(--motiongpu-color-foreground-muted);
|
|
144
|
+
}
|
|
145
|
+
.motiongpu-error-sections {
|
|
146
|
+
display: grid;
|
|
147
|
+
gap: 0.62rem;
|
|
148
|
+
margin-top: 0.95rem;
|
|
149
|
+
}
|
|
150
|
+
.motiongpu-error-source {
|
|
151
|
+
display: grid;
|
|
152
|
+
gap: 0.48rem;
|
|
153
|
+
margin-top: 0.96rem;
|
|
154
|
+
}
|
|
155
|
+
.motiongpu-error-source-title {
|
|
156
|
+
margin: 0;
|
|
157
|
+
font-size: 0.8rem;
|
|
158
|
+
font-weight: 500;
|
|
159
|
+
line-height: 1.3;
|
|
160
|
+
letter-spacing: 0.045em;
|
|
161
|
+
text-transform: uppercase;
|
|
162
|
+
color: var(--motiongpu-color-foreground);
|
|
163
|
+
}
|
|
164
|
+
.motiongpu-error-source-frame {
|
|
165
|
+
border: 1px solid var(--motiongpu-color-border);
|
|
166
|
+
border-radius: var(--motiongpu-radius-lg);
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
background: var(--motiongpu-color-background-muted);
|
|
169
|
+
}
|
|
170
|
+
.motiongpu-error-source-tabs {
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: stretch;
|
|
173
|
+
border-bottom: 1px solid var(--motiongpu-color-border);
|
|
174
|
+
background: var(--motiongpu-color-background);
|
|
175
|
+
}
|
|
176
|
+
.motiongpu-error-source-tab {
|
|
177
|
+
display: inline-flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
padding: 0.5rem 0.68rem;
|
|
180
|
+
font-size: 0.76rem;
|
|
181
|
+
font-weight: 400;
|
|
182
|
+
line-height: 1.2;
|
|
183
|
+
color: var(--motiongpu-color-foreground-muted);
|
|
184
|
+
border-right: 1px solid var(--motiongpu-color-border);
|
|
185
|
+
}
|
|
186
|
+
.motiongpu-error-source-tab-active {
|
|
187
|
+
color: var(--motiongpu-color-foreground);
|
|
188
|
+
background: var(--motiongpu-color-background-muted);
|
|
189
|
+
}
|
|
190
|
+
.motiongpu-error-source-tab-spacer {
|
|
191
|
+
flex: 1 1 auto;
|
|
192
|
+
}
|
|
193
|
+
.motiongpu-error-source-snippet {
|
|
194
|
+
display: grid;
|
|
195
|
+
background: var(--motiongpu-color-background-muted);
|
|
196
|
+
}
|
|
197
|
+
.motiongpu-error-source-row {
|
|
198
|
+
display: grid;
|
|
199
|
+
grid-template-columns: 2rem minmax(0, 1fr);
|
|
200
|
+
align-items: start;
|
|
201
|
+
gap: 0.42rem;
|
|
202
|
+
padding: 0.2rem 0.68rem;
|
|
203
|
+
}
|
|
204
|
+
.motiongpu-error-source-row-active {
|
|
205
|
+
background: color-mix(in oklch, var(--motiongpu-color-accent) 10%, transparent);
|
|
206
|
+
}
|
|
207
|
+
.motiongpu-error-source-line {
|
|
208
|
+
font-family: var(--motiongpu-font-mono);
|
|
209
|
+
font-size: 0.77rem;
|
|
210
|
+
font-weight: 400;
|
|
211
|
+
line-height: 1.3;
|
|
212
|
+
font-variant-numeric: tabular-nums;
|
|
213
|
+
font-feature-settings: 'tnum' 1;
|
|
214
|
+
border-right: 1px solid var(--motiongpu-color-border);
|
|
215
|
+
color: var(--motiongpu-color-foreground-muted);
|
|
216
|
+
text-align: left;
|
|
217
|
+
}
|
|
218
|
+
.motiongpu-error-source-code {
|
|
219
|
+
font-family: var(--motiongpu-font-mono);
|
|
220
|
+
font-size: 0.77rem;
|
|
221
|
+
font-weight: 400;
|
|
222
|
+
line-height: 1.3;
|
|
223
|
+
color: var(--motiongpu-color-foreground);
|
|
224
|
+
white-space: pre-wrap;
|
|
225
|
+
word-break: break-word;
|
|
226
|
+
}
|
|
227
|
+
.motiongpu-error-details {
|
|
228
|
+
border: 1px solid var(--motiongpu-color-border);
|
|
229
|
+
border-radius: var(--motiongpu-radius-lg);
|
|
230
|
+
overflow: hidden;
|
|
231
|
+
background: var(--motiongpu-color-background);
|
|
232
|
+
}
|
|
233
|
+
.motiongpu-error-details summary {
|
|
234
|
+
cursor: pointer;
|
|
235
|
+
padding: 0.56rem 0.68rem;
|
|
236
|
+
font-size: 0.7rem;
|
|
237
|
+
letter-spacing: 0.07em;
|
|
238
|
+
line-height: 1.2;
|
|
239
|
+
font-weight: 500;
|
|
240
|
+
text-transform: uppercase;
|
|
241
|
+
color: var(--motiongpu-color-foreground);
|
|
242
|
+
}
|
|
243
|
+
.motiongpu-error-details[open] summary {
|
|
244
|
+
border-bottom: 1px solid var(--motiongpu-color-border);
|
|
245
|
+
}
|
|
246
|
+
.motiongpu-error-details pre {
|
|
247
|
+
margin: 0;
|
|
248
|
+
padding: 0.62rem 0.68rem;
|
|
249
|
+
white-space: pre-wrap;
|
|
250
|
+
word-break: break-word;
|
|
251
|
+
overflow: auto;
|
|
252
|
+
background: var(--motiongpu-color-background-muted);
|
|
253
|
+
font-size: 0.74rem;
|
|
254
|
+
line-height: 1.4;
|
|
255
|
+
font-weight: 400;
|
|
256
|
+
color: var(--motiongpu-color-foreground);
|
|
257
|
+
font-family: var(--motiongpu-font-mono);
|
|
258
|
+
}
|
|
259
|
+
@media (max-width: 42rem) {
|
|
260
|
+
.motiongpu-error-overlay {
|
|
261
|
+
padding: 0.62rem;
|
|
262
|
+
}
|
|
263
|
+
.motiongpu-error-dialog {
|
|
264
|
+
padding: 0.85rem;
|
|
265
|
+
}
|
|
266
|
+
.motiongpu-error-title {
|
|
267
|
+
font-size: 1.02rem;
|
|
268
|
+
}
|
|
269
|
+
.motiongpu-error-header-top {
|
|
270
|
+
flex-direction: column;
|
|
271
|
+
align-items: flex-start;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
@media (prefers-reduced-motion: reduce) {
|
|
275
|
+
.motiongpu-error-overlay {
|
|
276
|
+
backdrop-filter: none;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.motiongpu-canvas-wrap {
|
|
281
|
+
position: relative;
|
|
282
|
+
width: 100%;
|
|
283
|
+
height: 100%;
|
|
284
|
+
min-width: 0;
|
|
285
|
+
min-height: 0;
|
|
286
|
+
overflow: hidden;
|
|
287
|
+
}
|
|
288
|
+
.motiongpu-canvas-wrap > canvas {
|
|
289
|
+
position: absolute;
|
|
290
|
+
inset: 0;
|
|
291
|
+
display: block;
|
|
292
|
+
width: 100%;
|
|
293
|
+
height: 100%;
|
|
294
|
+
}
|
|
295
|
+
/*$vite$:1*/
|
package/dist/react/advanced.js
CHANGED
|
@@ -8,7 +8,8 @@ import { applySchedulerPreset, captureSchedulerDebugSnapshot } from "../core/sch
|
|
|
8
8
|
import { useMotionGPU } from "./motiongpu-context.js";
|
|
9
9
|
import { useFrame } from "./frame-context.js";
|
|
10
10
|
import { FragCanvas } from "./FragCanvas.js";
|
|
11
|
+
import { usePointer } from "./use-pointer.js";
|
|
11
12
|
import { useTexture } from "./use-texture.js";
|
|
12
13
|
import "./index.js";
|
|
13
14
|
import { setMotionGPUUserContext, useMotionGPUUserContext, useSetMotionGPUUserContext } from "./use-motiongpu-user-context.js";
|
|
14
|
-
export { BlitPass, ComputePass, CopyPass, FragCanvas, PingPongComputePass, ShaderPass, applySchedulerPreset, captureSchedulerDebugSnapshot, defineMaterial, setMotionGPUUserContext, useFrame, useMotionGPU, useMotionGPUUserContext, useSetMotionGPUUserContext, useTexture };
|
|
15
|
+
export { BlitPass, ComputePass, CopyPass, FragCanvas, PingPongComputePass, ShaderPass, applySchedulerPreset, captureSchedulerDebugSnapshot, defineMaterial, setMotionGPUUserContext, useFrame, useMotionGPU, useMotionGPUUserContext, usePointer, useSetMotionGPUUserContext, useTexture };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -6,12 +6,14 @@ export { defineMaterial } from '../core/material.js';
|
|
|
6
6
|
export { BlitPass, CopyPass, ShaderPass, ComputePass, PingPongComputePass } from '../passes/index.js';
|
|
7
7
|
export { useMotionGPU } from './motiongpu-context.js';
|
|
8
8
|
export { useFrame } from './frame-context.js';
|
|
9
|
+
export { usePointer } from './use-pointer.js';
|
|
9
10
|
export { useTexture } from './use-texture.js';
|
|
10
11
|
export type { FrameInvalidationToken, FrameState, OutputColorSpace, AnyPass, ComputePassLike, RenderPass, RenderPassContext, RenderPassFlags, RenderPassInputSlot, RenderPassOutputSlot, RenderMode, RenderTarget, RenderTargetDefinition, RenderTargetDefinitionMap, TextureData, TextureDefinition, TextureDefinitionMap, TextureUpdateMode, TextureMap, TextureSource, TextureValue, TypedUniform, UniformMat4Value, UniformMap, UniformType, UniformValue } from '../core/types.js';
|
|
11
12
|
export type { LoadedTexture, TextureDecodeOptions, TextureLoadOptions } from '../core/texture-loader.js';
|
|
12
13
|
export type { FragMaterial, FragMaterialInput, MaterialIncludes, MaterialDefineValue, MaterialDefines, TypedMaterialDefineValue } from '../core/material.js';
|
|
13
14
|
export type { MotionGPUContext } from './motiongpu-context.js';
|
|
14
15
|
export type { UseFrameOptions, UseFrameResult } from './frame-context.js';
|
|
16
|
+
export type { PointerClick, PointerFrameRequestMode, PointerKind, PointerPoint, PointerState, UsePointerOptions, UsePointerResult } from './use-pointer.js';
|
|
15
17
|
export type { TextureUrlInput, UseTextureResult } from './use-texture.js';
|
|
16
18
|
export type { StorageBufferAccess, StorageBufferDefinition, StorageBufferDefinitionMap, StorageBufferType, ComputePassContext } from '../core/types.js';
|
|
17
19
|
export type { ComputePassOptions, ComputeDispatchContext } from '../passes/ComputePass.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-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AAqB,CAAC;AAC7B,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC1E,YAAY,EACX,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,YAAY,EACX,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC3F,YAAY,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/react/index.js
CHANGED
|
@@ -8,5 +8,6 @@ import "../passes/index.js";
|
|
|
8
8
|
import { useMotionGPU } from "./motiongpu-context.js";
|
|
9
9
|
import { useFrame } from "./frame-context.js";
|
|
10
10
|
import { FragCanvas } from "./FragCanvas.js";
|
|
11
|
+
import { usePointer } from "./use-pointer.js";
|
|
11
12
|
import { useTexture } from "./use-texture.js";
|
|
12
|
-
export { BlitPass, ComputePass, CopyPass, FragCanvas, PingPongComputePass, ShaderPass, defineMaterial, useFrame, useMotionGPU, useTexture };
|
|
13
|
+
export { BlitPass, ComputePass, CopyPass, FragCanvas, PingPongComputePass, ShaderPass, defineMaterial, useFrame, useMotionGPU, usePointer, useTexture };
|