@vgai/engine 0.5.16 → 0.5.18
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/adapter/adapter-module.d.ts +1 -16
- package/dist/adapter/adapter-module.d.ts.map +1 -1
- package/dist/adapter/adapter-module.js +1 -11
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts +0 -2
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts.map +1 -1
- package/dist/adapter/finders/scenes-from-entrypoint-selection.js +3 -6
- package/dist/adapter/renderer-config.d.ts +83 -0
- package/dist/adapter/renderer-config.d.ts.map +1 -0
- package/dist/adapter/renderer-config.js +121 -0
- package/dist/adapter/root-adapter.d.ts +6 -2
- package/dist/adapter/root-adapter.d.ts.map +1 -1
- package/dist/adapter/root-seam-contract.d.ts +5 -0
- package/dist/adapter/root-seam-contract.d.ts.map +1 -1
- package/dist/adapter/root-seam-contract.js +1 -0
- package/dist/adapter/setup-three-root-adapter.js +9 -9
- package/dist/canvas-react/pixi-react-adapter.d.ts.map +1 -1
- package/dist/canvas-react/pixi-react-adapter.js +92 -41
- package/dist/data/curve.d.ts +1 -1
- package/dist/data/curve.js +2 -2
- package/dist/dev/instruments.d.ts +4 -4
- package/dist/dev/instruments.js +4 -4
- package/dist/dev/register-render-vitals.d.ts +2 -2
- package/dist/dev/register-render-vitals.js +2 -2
- package/dist/dev/static-batch-advisor.d.ts +1 -1
- package/dist/dev/static-batch-advisor.js +2 -2
- package/dist/input/input-manager.d.ts +15 -0
- package/dist/input/input-manager.d.ts.map +1 -1
- package/dist/input/input-manager.js +22 -0
- package/dist/manifest/load.d.ts +0 -3
- package/dist/manifest/load.d.ts.map +1 -1
- package/dist/manifest/load.js +0 -4
- package/dist/manifest/schema.d.ts +0 -2
- package/dist/manifest/schema.d.ts.map +1 -1
- package/dist/manifest/schema.js +3 -24
- package/dist/pixi/authoring.d.ts +33 -0
- package/dist/pixi/authoring.d.ts.map +1 -1
- package/dist/pixi/authoring.js +86 -6
- package/dist/react/world-state.d.ts +12 -0
- package/dist/react/world-state.d.ts.map +1 -1
- package/dist/react/world-state.js +14 -0
- package/dist/render/soft-particle-depth.d.ts +3 -3
- package/dist/render/soft-particle-depth.d.ts.map +1 -1
- package/dist/render/soft-particle-depth.js +8 -13
- package/dist/runtime/create-runtime.d.ts +2 -16
- package/dist/runtime/create-runtime.d.ts.map +1 -1
- package/dist/runtime/create-runtime.js +36 -38
- package/dist/runtime/dev-build.d.ts +37 -0
- package/dist/runtime/dev-build.d.ts.map +1 -0
- package/dist/runtime/dev-build.js +49 -0
- package/dist/runtime/game.d.ts +9 -1
- package/dist/runtime/game.d.ts.map +1 -1
- package/dist/runtime/game.js +25 -1
- package/dist/runtime/mount-manifest.d.ts +0 -13
- package/dist/runtime/mount-manifest.d.ts.map +1 -1
- package/dist/runtime/mount-manifest.js +2 -21
- package/dist/world3d-react/engine-bridge.d.ts.map +1 -1
- package/dist/world3d-react/engine-bridge.js +28 -3
- package/dist/world3d-react/index.d.ts +2 -2
- package/dist/world3d-react/index.d.ts.map +1 -1
- package/dist/world3d-react/index.js +2 -2
- package/dist/world3d-react/r3f-adapter.d.ts +2 -2
- package/dist/world3d-react/r3f-adapter.d.ts.map +1 -1
- package/dist/world3d-react/r3f-adapter.js +90 -15
- package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -1
- package/dist/world3d-react/r3f-root-factory.js +12 -2
- package/dist/world3d-react/rapier-physics-bridge.d.ts +4 -4
- package/dist/world3d-react/rapier-physics-bridge.js +3 -3
- package/dist/world3d-react/renderer-config.d.ts +7 -69
- package/dist/world3d-react/renderer-config.d.ts.map +1 -1
- package/dist/world3d-react/renderer-config.js +7 -108
- package/dist/world3d-react/world-context.d.ts +43 -0
- package/dist/world3d-react/world-context.d.ts.map +1 -1
- package/dist/world3d-react/world-context.js +89 -46
- package/dist-config/config.js.map +1 -1
- package/package.json +1 -1
- package/schemas/engine-capabilities.json +3 -3
- package/schemas/vgai-project.schema.json +2 -7
- package/src/adapter/adapter-module.ts +1 -25
- package/src/adapter/finders/scenes-from-entrypoint-selection.ts +3 -8
- package/src/adapter/renderer-config.ts +178 -0
- package/src/adapter/root-adapter.ts +6 -2
- package/src/adapter/root-seam-contract.ts +1 -0
- package/src/adapter/setup-three-root-adapter.ts +9 -9
- package/src/canvas-react/pixi-react-adapter.tsx +98 -53
- package/src/data/curve.ts +2 -2
- package/src/dev/instruments.ts +4 -4
- package/src/dev/register-render-vitals.ts +2 -2
- package/src/dev/static-batch-advisor.ts +2 -2
- package/src/input/input-manager.ts +23 -0
- package/src/manifest/load.ts +0 -7
- package/src/manifest/schema.ts +3 -26
- package/src/pixi/authoring.ts +98 -6
- package/src/react/world-state.tsx +15 -0
- package/src/render/soft-particle-depth.ts +8 -13
- package/src/runtime/create-runtime.ts +38 -52
- package/src/runtime/dev-build.ts +49 -0
- package/src/runtime/game.ts +31 -2
- package/src/runtime/mount-manifest.ts +2 -33
- package/src/world3d-react/engine-bridge.ts +28 -3
- package/src/world3d-react/index.ts +5 -5
- package/src/world3d-react/r3f-adapter.tsx +89 -20
- package/src/world3d-react/r3f-root-factory.tsx +12 -2
- package/src/world3d-react/rapier-physics-bridge.tsx +4 -4
- package/src/world3d-react/renderer-config.ts +7 -164
- package/src/world3d-react/world-context.ts +100 -51
- package/dist/runtime/dev-layers.d.ts +0 -34
- package/dist/runtime/dev-layers.d.ts.map +0 -1
- package/dist/runtime/dev-layers.js +0 -46
- package/src/runtime/dev-layers.ts +0 -46
|
@@ -88,18 +88,6 @@ export interface AdapterRegion {
|
|
|
88
88
|
readonly id: string;
|
|
89
89
|
/** What the host hands this root. */
|
|
90
90
|
readonly surface: AdapterSurface;
|
|
91
|
-
/**
|
|
92
|
-
* `true` = this region grades the game's own DEV LAYER (the manifest root's
|
|
93
|
-
* `dev: true`), not shipped game content.
|
|
94
|
-
*
|
|
95
|
-
* Carried here because a dev root occupies the same MEDIUM as the content
|
|
96
|
-
* root beside it — a dev GUI is a `dom` root next to the HUD's `dom` root —
|
|
97
|
-
* and anything that maps a subject to "the region on this surface" would
|
|
98
|
-
* otherwise be choosing between them by array order. A region consumer that
|
|
99
|
-
* means shipped content says so by skipping `dev` regions (the loader's
|
|
100
|
-
* `regionForSurface` does), rather than by guessing which one matched.
|
|
101
|
-
*/
|
|
102
|
-
readonly dev: boolean;
|
|
103
91
|
/** Projection library, by name. */
|
|
104
92
|
readonly projector: ProjectorName;
|
|
105
93
|
/**
|
|
@@ -264,9 +252,7 @@ export declare function regionsFromManifestRoots(roots: readonly ResolvedAdapter
|
|
|
264
252
|
export declare function unmatchedRegionIncludeIds(roots: readonly ResolvedAdapterRoot[], regionIncludes: Readonly<Record<string, AdapterRegionOverlay>>): string[];
|
|
265
253
|
/**
|
|
266
254
|
* The rule form of a finder's region targeting: every region the host mounts
|
|
267
|
-
* from an exported composition
|
|
268
|
-
* DEV layer. A dev root is the game's own dev GUI — the manifest already says
|
|
269
|
-
* so (`dev: true`), so skipping it reads a declaration rather than guessing.
|
|
255
|
+
* from an exported composition — a root with an `entry`.
|
|
270
256
|
*/
|
|
271
257
|
export declare const EXPORTED_COMPOSITION_REGIONS = "exported-composition-regions";
|
|
272
258
|
/**
|
|
@@ -511,7 +497,6 @@ export declare const AdapterDefinitionSchema: z.ZodObject<{
|
|
|
511
497
|
canvas: "canvas";
|
|
512
498
|
dom: "dom";
|
|
513
499
|
}>;
|
|
514
|
-
dev: z.ZodBoolean;
|
|
515
500
|
projector: z.ZodEnum<{
|
|
516
501
|
three: "three";
|
|
517
502
|
dom: "dom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-module.d.ts","sourceRoot":"","sources":["../../src/adapter/adapter-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,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AAcD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA1Gf,OAAO,KAAK,OAAO,SAAnB,OAAO,KAAK,OAAO;;;;oCA0Cb,OAAO,KAAK,SAAS,kBAAkB,EAAE,SAAzC,OAAO,KAAK,SAAS,kBAAkB,EAAE;gCAE7C,OAAO,UAAU,MAAM,SAAS,iBAAiB,KAAK,IAAI,SAA1D,OAAO,UAAU,MAAM,SAAS,iBAAiB,KAAK,IAAI;kCAExD,OAAO,KAAK,IAAI,SAAhB,OAAO,KAAK,IAAI;;kBA+EtC,CAAC;AAEJ;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,GAAE,sBAA2B,GAAG,iBAAiB,CAgBnF;AAED,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,mFAAmF;IACnF,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC;oDACgD;IAChD,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC;CAC1E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,iBAAiB,CAYnF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,CAQxE"}
|
|
@@ -84,10 +84,6 @@ const AdapterRegionSchema = z
|
|
|
84
84
|
.object({
|
|
85
85
|
id: z.string().min(1).describe('Manifest root id this region grades'),
|
|
86
86
|
surface: z.enum(['three', 'canvas', 'dom']).describe('Render surface the host hands this root'),
|
|
87
|
-
dev: z
|
|
88
|
-
.boolean()
|
|
89
|
-
.describe("true = this region grades the game's own dev layer, not shipped content (the " +
|
|
90
|
-
"manifest root's `dev: true`)"),
|
|
91
87
|
projector: z.enum(PROJECTOR_NAMES).describe('Projection library serving this surface, by name'),
|
|
92
88
|
dialect: z
|
|
93
89
|
.string()
|
|
@@ -229,7 +225,6 @@ export function unmatchedRegionIncludeIds(roots, regionIncludes) {
|
|
|
229
225
|
/** One root's region, before any declared parameters are merged onto it. */
|
|
230
226
|
function derivedRegion(root) {
|
|
231
227
|
const surface = root.surface;
|
|
232
|
-
const dev = root.dev;
|
|
233
228
|
const firstParty = root.adapter.type === 'builtin';
|
|
234
229
|
const projector = surface === 'canvas' ? 'pixi' : surface;
|
|
235
230
|
const basis = NATIVE_REGION_BASIS;
|
|
@@ -237,7 +232,6 @@ function derivedRegion(root) {
|
|
|
237
232
|
return {
|
|
238
233
|
id: root.id,
|
|
239
234
|
surface,
|
|
240
|
-
dev,
|
|
241
235
|
projector,
|
|
242
236
|
dialect: null,
|
|
243
237
|
anchors: ['live-only'],
|
|
@@ -248,7 +242,6 @@ function derivedRegion(root) {
|
|
|
248
242
|
return {
|
|
249
243
|
id: root.id,
|
|
250
244
|
surface,
|
|
251
|
-
dev,
|
|
252
245
|
projector,
|
|
253
246
|
dialect: 'jsx',
|
|
254
247
|
anchors: ['source-prop', 'source-structure'],
|
|
@@ -258,7 +251,6 @@ function derivedRegion(root) {
|
|
|
258
251
|
return {
|
|
259
252
|
id: root.id,
|
|
260
253
|
surface,
|
|
261
|
-
dev,
|
|
262
254
|
projector,
|
|
263
255
|
dialect: surface === 'three' ? 'r3f' : 'pixi-react',
|
|
264
256
|
anchors: ['source-prop', 'source-structure', 'construction-literal'],
|
|
@@ -270,9 +262,7 @@ function derivedRegion(root) {
|
|
|
270
262
|
// ---------------------------------------------------------------------------
|
|
271
263
|
/**
|
|
272
264
|
* The rule form of a finder's region targeting: every region the host mounts
|
|
273
|
-
* from an exported composition
|
|
274
|
-
* DEV layer. A dev root is the game's own dev GUI — the manifest already says
|
|
275
|
-
* so (`dev: true`), so skipping it reads a declaration rather than guessing.
|
|
265
|
+
* from an exported composition — a root with an `entry`.
|
|
276
266
|
*/
|
|
277
267
|
export const EXPORTED_COMPOSITION_REGIONS = 'exported-composition-regions';
|
|
278
268
|
/** The finder names, as a value — what the loader's dispatcher switches on. */
|
|
@@ -45,8 +45,6 @@ export interface EntrypointSource {
|
|
|
45
45
|
readonly path: string;
|
|
46
46
|
/** The module's bytes; `null` when they could not be read. */
|
|
47
47
|
readonly source: string | null;
|
|
48
|
-
/** The root's declared `dev` flag — a dev layer is the game's own dev GUI. */
|
|
49
|
-
readonly dev: boolean;
|
|
50
48
|
}
|
|
51
49
|
export interface ScenesFromEntrypointSelectionInput {
|
|
52
50
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenes-from-entrypoint-selection.d.ts","sourceRoot":"","sources":["../../../src/adapter/finders/scenes-from-entrypoint-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,KAAK,EAGV,mCAAmC,EACpC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"scenes-from-entrypoint-selection.d.ts","sourceRoot":"","sources":["../../../src/adapter/finders/scenes-from-entrypoint-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,KAAK,EAGV,mCAAmC,EACpC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,kCAAkC;IACjD;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACjF;AA+TD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,mCAAmC,EAC3C,KAAK,EAAE,kCAAkC,GACxC,YAAY,CA8Bd"}
|
|
@@ -227,15 +227,12 @@ function sourceFor(binding, fromPath, resolveModule) {
|
|
|
227
227
|
/**
|
|
228
228
|
* Which entrypoints this selection targets.
|
|
229
229
|
*
|
|
230
|
-
* The RULE form is every exported-composition region
|
|
231
|
-
*
|
|
232
|
-
* GUI is edit-time chrome, not authorable game content — never a name
|
|
233
|
-
* heuristic. A named region with no matching entrypoint becomes a note, not a
|
|
234
|
-
* silent omission.
|
|
230
|
+
* The RULE form is every exported-composition region. A named region with no
|
|
231
|
+
* matching entrypoint becomes a note, not a silent omission.
|
|
235
232
|
*/
|
|
236
233
|
function targetedEntrypoints(params, entrypoints, notes) {
|
|
237
234
|
if (params.regions === EXPORTED_COMPOSITION_REGIONS) {
|
|
238
|
-
return entrypoints
|
|
235
|
+
return [...entrypoints];
|
|
239
236
|
}
|
|
240
237
|
const found = [];
|
|
241
238
|
for (const regionId of params.regions) {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* adapter/renderer-config.ts — the seam a WORLD uses to state how its own frame is rendered.
|
|
3
|
+
*
|
|
4
|
+
* It lives in the ADAPTER SEAM, not in a surface entry, because `WorldRendererConfig` IS part of
|
|
5
|
+
* the root contract: `MountedThreeRoot.rendererConfig` reports it (`./root-adapter.ts`) and
|
|
6
|
+
* `./root-seam-contract.ts` already lists it as a contract field. The seam defines the shape; the
|
|
7
|
+
* surface entries and the editor CONFORM to it — `world3d-react/r3f-adapter.tsx` is the declarer,
|
|
8
|
+
* `runtime/create-runtime.ts` the host, `editor/src/components/ViewportPanel.tsx` the editor's
|
|
9
|
+
* applier. Do NOT move it back under `world3d-react/`: nothing here touches react, and a core
|
|
10
|
+
* adapter file reaching into a react entry is exactly what `react-core-import-ban.test.ts` forbids
|
|
11
|
+
* (that ban carries no type-only carve-out on purpose — unlike its pixi sibling, whose carve-out
|
|
12
|
+
* exists only because `PIXI.Container` is a third-party type core cannot relocate).
|
|
13
|
+
*
|
|
14
|
+
* The host owns the `WebGLRenderer` (`ThreeHostContext.renderer`) and configures it with this
|
|
15
|
+
* engine's defaults: ACES tone mapping, sRGB output, PCF-soft shadows. Those defaults are right for
|
|
16
|
+
* a world authored against them and WRONG for a world that was authored against a different
|
|
17
|
+
* engine's pipeline — an imported Godot 3 GLES2 game does gamma-space lighting with no tonemapper
|
|
18
|
+
* at all, so ACES quietly desaturates and darkens every colour its author picked.
|
|
19
|
+
*
|
|
20
|
+
* So a world may DECLARE the pipeline it was authored for, and `createR3FAdapter` applies it to the
|
|
21
|
+
* host's renderer for the life of the mount, restoring what it found on dispose. Three properties
|
|
22
|
+
* of that shape are load-bearing:
|
|
23
|
+
*
|
|
24
|
+
* - **It is per-renderer, never engine-wide.** Every field here is a `WebGLRenderer` instance
|
|
25
|
+
* property, and a play root gets its own renderer (`create-runtime.ts`). Nothing here reaches a
|
|
26
|
+
* module-level three global, so one world's declaration cannot change how the editor's own
|
|
27
|
+
* viewport, another root, or a thumbnail bake renders.
|
|
28
|
+
* - **Absent means "leave the host's value alone".** Every field is optional and an omitted one
|
|
29
|
+
* is never written, so declaring a tone mapping does not silently reset the clear colour.
|
|
30
|
+
* - **It is restored on dispose.** The renderer outlives the mount, so a world that did not put
|
|
31
|
+
* back what it found would leak its pipeline into whatever mounts next.
|
|
32
|
+
*
|
|
33
|
+
* This is deliberately NOT a general render-settings system. It carries what a world can honestly
|
|
34
|
+
* state about its own colour pipeline and nothing else; a property the host fixes at CONSTRUCTION
|
|
35
|
+
* (the WebGL context's `antialias` attribute, and therefore the MSAA sample count) cannot be
|
|
36
|
+
* declared here, because there would be no honest moment to apply it.
|
|
37
|
+
*/
|
|
38
|
+
import type * as THREE from 'three';
|
|
39
|
+
/** The tone-mapping operators three exposes, named as data rather than as three's numeric enum. */
|
|
40
|
+
export type WorldToneMapping = 'none' | 'linear' | 'reinhard' | 'cineon' | 'aces' | 'agx' | 'neutral';
|
|
41
|
+
/**
|
|
42
|
+
* The output transfer function the frame is written with.
|
|
43
|
+
*
|
|
44
|
+
* - `srgb` — three's own default and this engine's: linear lighting, sRGB encode on output.
|
|
45
|
+
* - `srgb-linear` — NO output transform. This is what a gamma-space renderer needs: the shading
|
|
46
|
+
* result is already in display space and encoding it a second time washes the frame out.
|
|
47
|
+
*/
|
|
48
|
+
export type WorldOutputColorSpace = 'srgb' | 'srgb-linear';
|
|
49
|
+
/**
|
|
50
|
+
* The shadow-map filter, named as data rather than as three's numeric enum.
|
|
51
|
+
*
|
|
52
|
+
* This is a renderer INSTANCE property (`WebGLRenderer.shadowMap.type`), not a context attribute,
|
|
53
|
+
* so unlike MSAA it has an honest moment at which a world can ask for it — which is the whole test
|
|
54
|
+
* this file's header states. A source engine that declares its own shadow filter (Godot 3's
|
|
55
|
+
* `rendering/quality/shadows/filter_mode`) would otherwise inherit whatever the host built with.
|
|
56
|
+
*/
|
|
57
|
+
export type WorldShadowMapType = 'basic' | 'pcf' | 'pcf-soft' | 'vsm';
|
|
58
|
+
/** What a world may declare about the renderer that draws it. Every field is optional; see header. */
|
|
59
|
+
export interface WorldRendererConfig {
|
|
60
|
+
readonly toneMapping?: WorldToneMapping | undefined;
|
|
61
|
+
readonly toneMappingExposure?: number | undefined;
|
|
62
|
+
readonly outputColorSpace?: WorldOutputColorSpace | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* `WebGLRenderer.shadowMap.type`. Writing it after a shadow map has already been built needs
|
|
65
|
+
* `shadowMap.needsUpdate`, which this function sets — three caches the compiled depth material
|
|
66
|
+
* per type and would otherwise keep filtering with the previous one.
|
|
67
|
+
*/
|
|
68
|
+
readonly shadowMapType?: WorldShadowMapType | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* The colour the frame is cleared to, as a CSS hex string. The renderer's existing clear ALPHA
|
|
71
|
+
* is preserved: a stacked canvas is transparent on purpose (`create-runtime.ts` gives every
|
|
72
|
+
* non-bottom root `alpha: true`), and forcing it opaque here would hide every layer below.
|
|
73
|
+
*/
|
|
74
|
+
readonly clearColor?: string | undefined;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Apply `config` to `renderer`, returning the restore function that puts back what was there.
|
|
78
|
+
*
|
|
79
|
+
* `three` is passed in rather than imported for values so the enum constants come from the HOST's
|
|
80
|
+
* three instance — the same identity rule `r3f-adapter.tsx` follows for the scene and camera.
|
|
81
|
+
*/
|
|
82
|
+
export declare function applyWorldRendererConfig(three: typeof THREE, renderer: THREE.WebGLRenderer, config: WorldRendererConfig): () => void;
|
|
83
|
+
//# sourceMappingURL=renderer-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-config.d.ts","sourceRoot":"","sources":["../../src/adapter/renderer-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,mGAAmG;AACnG,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,MAAM,GACN,KAAK,GACL,SAAS,CAAC;AAEd;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,aAAa,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,KAAK,CAAC;AAEtE,sGAAsG;AACtG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC9D;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACxD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,KAAK,EACnB,QAAQ,EAAE,KAAK,CAAC,aAAa,EAC7B,MAAM,EAAE,mBAAmB,GAC1B,MAAM,IAAI,CA+EZ"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* adapter/renderer-config.ts — the seam a WORLD uses to state how its own frame is rendered.
|
|
3
|
+
*
|
|
4
|
+
* It lives in the ADAPTER SEAM, not in a surface entry, because `WorldRendererConfig` IS part of
|
|
5
|
+
* the root contract: `MountedThreeRoot.rendererConfig` reports it (`./root-adapter.ts`) and
|
|
6
|
+
* `./root-seam-contract.ts` already lists it as a contract field. The seam defines the shape; the
|
|
7
|
+
* surface entries and the editor CONFORM to it — `world3d-react/r3f-adapter.tsx` is the declarer,
|
|
8
|
+
* `runtime/create-runtime.ts` the host, `editor/src/components/ViewportPanel.tsx` the editor's
|
|
9
|
+
* applier. Do NOT move it back under `world3d-react/`: nothing here touches react, and a core
|
|
10
|
+
* adapter file reaching into a react entry is exactly what `react-core-import-ban.test.ts` forbids
|
|
11
|
+
* (that ban carries no type-only carve-out on purpose — unlike its pixi sibling, whose carve-out
|
|
12
|
+
* exists only because `PIXI.Container` is a third-party type core cannot relocate).
|
|
13
|
+
*
|
|
14
|
+
* The host owns the `WebGLRenderer` (`ThreeHostContext.renderer`) and configures it with this
|
|
15
|
+
* engine's defaults: ACES tone mapping, sRGB output, PCF-soft shadows. Those defaults are right for
|
|
16
|
+
* a world authored against them and WRONG for a world that was authored against a different
|
|
17
|
+
* engine's pipeline — an imported Godot 3 GLES2 game does gamma-space lighting with no tonemapper
|
|
18
|
+
* at all, so ACES quietly desaturates and darkens every colour its author picked.
|
|
19
|
+
*
|
|
20
|
+
* So a world may DECLARE the pipeline it was authored for, and `createR3FAdapter` applies it to the
|
|
21
|
+
* host's renderer for the life of the mount, restoring what it found on dispose. Three properties
|
|
22
|
+
* of that shape are load-bearing:
|
|
23
|
+
*
|
|
24
|
+
* - **It is per-renderer, never engine-wide.** Every field here is a `WebGLRenderer` instance
|
|
25
|
+
* property, and a play root gets its own renderer (`create-runtime.ts`). Nothing here reaches a
|
|
26
|
+
* module-level three global, so one world's declaration cannot change how the editor's own
|
|
27
|
+
* viewport, another root, or a thumbnail bake renders.
|
|
28
|
+
* - **Absent means "leave the host's value alone".** Every field is optional and an omitted one
|
|
29
|
+
* is never written, so declaring a tone mapping does not silently reset the clear colour.
|
|
30
|
+
* - **It is restored on dispose.** The renderer outlives the mount, so a world that did not put
|
|
31
|
+
* back what it found would leak its pipeline into whatever mounts next.
|
|
32
|
+
*
|
|
33
|
+
* This is deliberately NOT a general render-settings system. It carries what a world can honestly
|
|
34
|
+
* state about its own colour pipeline and nothing else; a property the host fixes at CONSTRUCTION
|
|
35
|
+
* (the WebGL context's `antialias` attribute, and therefore the MSAA sample count) cannot be
|
|
36
|
+
* declared here, because there would be no honest moment to apply it.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Apply `config` to `renderer`, returning the restore function that puts back what was there.
|
|
40
|
+
*
|
|
41
|
+
* `three` is passed in rather than imported for values so the enum constants come from the HOST's
|
|
42
|
+
* three instance — the same identity rule `r3f-adapter.tsx` follows for the scene and camera.
|
|
43
|
+
*/
|
|
44
|
+
export function applyWorldRendererConfig(three, renderer, config) {
|
|
45
|
+
// A host that mounts a world WITHOUT rasterizing it hands the adapter a duck-typed renderer —
|
|
46
|
+
// the editor's design session (`createDesignTimeRenderer`: four members, deliberately never
|
|
47
|
+
// widened) and jsdom test harnesses both do. Such a surface has no colour pipeline to configure:
|
|
48
|
+
// the frame the user sees is drawn by a DIFFERENT renderer (the editor's own), so applying the
|
|
49
|
+
// world's config there is meaningless — and calling `getClearColor` on it is a TypeError that
|
|
50
|
+
// unmounts the whole world at edit time (measured: every Godot port's edit viewport blanked with
|
|
51
|
+
// '"world" failed to mount — renderer.getClearColor is not a function'). Detect the real
|
|
52
|
+
// `WebGLRenderer` surface by the one method this function must call, and no-op otherwise.
|
|
53
|
+
if (typeof renderer.getClearColor !== 'function') {
|
|
54
|
+
return () => { };
|
|
55
|
+
}
|
|
56
|
+
const toneMappings = {
|
|
57
|
+
none: three.NoToneMapping,
|
|
58
|
+
linear: three.LinearToneMapping,
|
|
59
|
+
reinhard: three.ReinhardToneMapping,
|
|
60
|
+
cineon: three.CineonToneMapping,
|
|
61
|
+
aces: three.ACESFilmicToneMapping,
|
|
62
|
+
agx: three.AgXToneMapping,
|
|
63
|
+
neutral: three.NeutralToneMapping,
|
|
64
|
+
};
|
|
65
|
+
const colorSpaces = {
|
|
66
|
+
srgb: three.SRGBColorSpace,
|
|
67
|
+
'srgb-linear': three.LinearSRGBColorSpace,
|
|
68
|
+
};
|
|
69
|
+
const shadowMapTypes = {
|
|
70
|
+
basic: three.BasicShadowMap,
|
|
71
|
+
pcf: three.PCFShadowMap,
|
|
72
|
+
'pcf-soft': three.PCFSoftShadowMap,
|
|
73
|
+
vsm: three.VSMShadowMap,
|
|
74
|
+
};
|
|
75
|
+
const restores = [];
|
|
76
|
+
if (config.toneMapping !== undefined) {
|
|
77
|
+
const previous = renderer.toneMapping;
|
|
78
|
+
renderer.toneMapping = toneMappings[config.toneMapping];
|
|
79
|
+
restores.push(() => {
|
|
80
|
+
renderer.toneMapping = previous;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (config.toneMappingExposure !== undefined) {
|
|
84
|
+
const previous = renderer.toneMappingExposure;
|
|
85
|
+
renderer.toneMappingExposure = config.toneMappingExposure;
|
|
86
|
+
restores.push(() => {
|
|
87
|
+
renderer.toneMappingExposure = previous;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (config.outputColorSpace !== undefined) {
|
|
91
|
+
const previous = renderer.outputColorSpace;
|
|
92
|
+
renderer.outputColorSpace = colorSpaces[config.outputColorSpace];
|
|
93
|
+
restores.push(() => {
|
|
94
|
+
renderer.outputColorSpace = previous;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (config.shadowMapType !== undefined && renderer.shadowMap !== undefined) {
|
|
98
|
+
const previous = renderer.shadowMap.type;
|
|
99
|
+
renderer.shadowMap.type = shadowMapTypes[config.shadowMapType];
|
|
100
|
+
renderer.shadowMap.needsUpdate = true;
|
|
101
|
+
restores.push(() => {
|
|
102
|
+
renderer.shadowMap.type = previous;
|
|
103
|
+
renderer.shadowMap.needsUpdate = true;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (config.clearColor !== undefined) {
|
|
107
|
+
const previousColor = new three.Color();
|
|
108
|
+
renderer.getClearColor(previousColor);
|
|
109
|
+
// Alpha is READ BACK and re-passed, never assumed: see `clearColor`'s doc above.
|
|
110
|
+
const alpha = renderer.getClearAlpha();
|
|
111
|
+
renderer.setClearColor(new three.Color(config.clearColor), alpha);
|
|
112
|
+
restores.push(() => {
|
|
113
|
+
renderer.setClearColor(previousColor, alpha);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return () => {
|
|
117
|
+
// Reverse order, so a field written twice (it cannot be, today) unwinds correctly.
|
|
118
|
+
for (let i = restores.length - 1; i >= 0; i--)
|
|
119
|
+
restores[i]?.();
|
|
120
|
+
};
|
|
121
|
+
}
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Container } from 'pixi.js';
|
|
10
10
|
import type * as THREE from 'three';
|
|
11
|
-
import type { WorldRendererConfig } from '../world3d-react/renderer-config';
|
|
12
11
|
import type { AdapterSurface } from './adapter-surface';
|
|
13
12
|
import type { AuthoringAdapter } from './authoring';
|
|
14
13
|
import type { HostContextFor } from './host-context';
|
|
14
|
+
import type { WorldRendererConfig } from './renderer-config';
|
|
15
15
|
import type { SystemAdapters } from './system-adapter';
|
|
16
16
|
/**
|
|
17
17
|
* The ingested-world observation contract (T7.4 slice 2, "the
|
|
@@ -67,6 +67,10 @@ export interface MountedRootBase {
|
|
|
67
67
|
step?(): void;
|
|
68
68
|
resize?(width: number, height: number): void;
|
|
69
69
|
dispose(): void;
|
|
70
|
+
/** Resolves after an asynchronous native reconciler has run every component
|
|
71
|
+
* cleanup started by {@link dispose}. Omitted by synchronously-disposing
|
|
72
|
+
* roots. Hosts use this before auditing/reclaiming realm-owned resources. */
|
|
73
|
+
readonly disposeComplete?: Promise<void>;
|
|
70
74
|
/** Optional capability providers — absence = "not supported", host degrades. */
|
|
71
75
|
readonly authoring?: AuthoringAdapter;
|
|
72
76
|
readonly systems?: SystemAdapters;
|
|
@@ -87,7 +91,7 @@ export interface MountedThreeRoot extends MountedRootBase {
|
|
|
87
91
|
/**
|
|
88
92
|
* The colour pipeline this world was authored for, REPORTED rather than
|
|
89
93
|
* applied — the adapter has already applied it to the renderer its own host
|
|
90
|
-
* handed it (
|
|
94
|
+
* handed it (`./renderer-config.ts`).
|
|
91
95
|
*
|
|
92
96
|
* It is here because the host that MOUNTS a world is not always the host
|
|
93
97
|
* that DRAWS it. The editor's design session mounts against a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/root-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"root-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/root-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C;;;;;;OAMG;IACH,QAAQ,IAAI,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAEhC,MAAM,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,IAAI,CAAC,IAA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AAQ,GAChB,eAAe,GACf,CAAC,SAAS,KAAK,GACb,gBAAgB,GAChB,KAAK,CAAC;AAEd;;;;;;;;;;GAUG;AACH;;;;;;GAMG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,cAAc,GAAG,OAAO;IAC7D,kDAAkD;IAClD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;kBACc;IACd,KAAK,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,cAAc,IAAI;IACxD,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC;AAEF;;;;oEAIoE;AACpE,MAAM,MAAM,cAAc,GACtB,iBAAiB,CAAC,OAAO,CAAC,GAC1B,iBAAiB,CAAC,QAAQ,CAAC,GAC3B,iBAAiB,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -47,6 +47,11 @@ export declare const MOUNTED_ROOT_BASE_SHAPE: {
|
|
|
47
47
|
readonly kind: "function";
|
|
48
48
|
readonly required: "effect";
|
|
49
49
|
};
|
|
50
|
+
readonly disposeComplete: {
|
|
51
|
+
readonly optional: true;
|
|
52
|
+
readonly kind: "value";
|
|
53
|
+
readonly required: "effect";
|
|
54
|
+
};
|
|
50
55
|
readonly authoring: {
|
|
51
56
|
readonly optional: true;
|
|
52
57
|
readonly kind: "value";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-seam-contract.d.ts","sourceRoot":"","sources":["../../src/adapter/root-seam-contract.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAazE,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAG7B,CAAC;AAEH,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"root-seam-contract.d.ts","sourceRoot":"","sources":["../../src/adapter/root-seam-contract.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAazE,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAG7B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYlC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAGpC,CAAC;AAMH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;CAKtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;CAGvC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAGpC,CAAC"}
|
|
@@ -12,6 +12,7 @@ export const MOUNTED_ROOT_BASE_SHAPE = defineSeamShape()({
|
|
|
12
12
|
step: { optional: true, kind: 'function', required: 'effect' },
|
|
13
13
|
resize: { optional: true, kind: 'function', required: 'effect' },
|
|
14
14
|
dispose: { optional: false, kind: 'function', required: 'effect' },
|
|
15
|
+
disposeComplete: { optional: true, kind: 'value', required: 'effect' },
|
|
15
16
|
authoring: { optional: true, kind: 'value', required: 'operation' },
|
|
16
17
|
systems: { optional: true, kind: 'value', required: 'operation' },
|
|
17
18
|
observe: { optional: true, kind: 'value', required: 'effect' },
|
|
@@ -44,7 +44,7 @@ import { createSoftParticleDepthPass } from '../render/soft-particle-depth';
|
|
|
44
44
|
import { disposeSparkRendererWhenIdle, SPARK_DISCOVERY_INTERVAL_MS, sceneHasGaussianSplat, shouldDiscoverGaussianSplat, } from '../render/spark-renderer-lifecycle';
|
|
45
45
|
import { ViewportShadingRenderer } from '../render/viewport-shading';
|
|
46
46
|
import { createDebugRegistry, getDebugRegistry, } from '../runtime/debug-registry';
|
|
47
|
-
import {
|
|
47
|
+
import { devBuildEnabled } from '../runtime/dev-build';
|
|
48
48
|
import { disposeDebrisSubtree } from '../runtime/game';
|
|
49
49
|
import { setupAudio } from '../setup/setup-audio';
|
|
50
50
|
import { setupParticles } from '../setup/setup-particles';
|
|
@@ -485,8 +485,8 @@ export class SetupThreeRootAdapter {
|
|
|
485
485
|
// registry, with no capability to install and nothing for a game to write.
|
|
486
486
|
//
|
|
487
487
|
// THE GATE, in one place. Three conditions, and the reason for each:
|
|
488
|
-
// 1. `
|
|
489
|
-
// context" (`runtime/dev-
|
|
488
|
+
// 1. `devBuildEnabled()` — the ONE owner of "is this a dev/editor
|
|
489
|
+
// context" (`runtime/dev-build.ts`). A ship build registers nothing,
|
|
490
490
|
// subscribes to nothing, and never enables the profiler.
|
|
491
491
|
// 2. a `Game` shell exists — the readings are folded out of that game's
|
|
492
492
|
// profiler frames, and a bare mount has no profiler to fold.
|
|
@@ -514,12 +514,12 @@ export class SetupThreeRootAdapter {
|
|
|
514
514
|
// The packaged runtime bakes `import.meta.env.DEV = false` into its
|
|
515
515
|
// prebuilt bundle, which is a fact about how the EDITOR was built, not
|
|
516
516
|
// about whether this mount is a dev session — found live: a
|
|
517
|
-
// package-native project's vitals never seeded while its
|
|
518
|
-
//
|
|
519
|
-
//
|
|
520
|
-
//
|
|
521
|
-
//
|
|
522
|
-
if (!host.game || headless || !
|
|
517
|
+
// package-native project's vitals never seeded while its capabilities
|
|
518
|
+
// and every other project-graph module ran fine. The override argument
|
|
519
|
+
// is `devBuildEnabled`'s own documented seam for exactly this
|
|
520
|
+
// caller-knows-better case; a standalone/ship mount (no editorPreview)
|
|
521
|
+
// still resolves purely from the build env.
|
|
522
|
+
if (!host.game || headless || !devBuildEnabled(editorPreview ? true : undefined))
|
|
523
523
|
return;
|
|
524
524
|
renderVitals?.dispose();
|
|
525
525
|
host.game.profiler.enabled = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-react-adapter.d.ts","sourceRoot":"","sources":["../../src/canvas-react/pixi-react-adapter.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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