@threenative/core 0.3.11 → 0.3.12
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/capabilities.json +1096 -26
- package/dist/camera-shake-CZKOfGn4.d.ts +46 -0
- package/dist/{canvas-layer-vCtanIeB.d.ts → canvas-layer-CWuFRT7G.d.ts} +1 -1
- package/dist/chunk-2Z44XSI2.js +35 -0
- package/dist/chunk-5O73CDMR.js +1849 -0
- package/dist/chunk-6KLNISRJ.js +153 -0
- package/dist/chunk-7UUT3TY5.js +133 -0
- package/dist/chunk-CFGTPFUH.js +231 -0
- package/dist/chunk-DBELTTTM.js +615 -0
- package/dist/chunk-GMHATRPW.js +7701 -0
- package/dist/chunk-GXY7B3JG.js +46 -0
- package/dist/chunk-KIRUKTBQ.js +187 -0
- package/dist/chunk-N5LRP4BR.js +220 -0
- package/dist/chunk-OKXUCASC.js +2238 -0
- package/dist/chunk-QWJEMUUT.js +94 -0
- package/dist/chunk-VAZM36TV.js +497 -0
- package/dist/{game-DzMcitDO.d.ts → game-D7pAzZUY.d.ts} +15 -3
- package/dist/hot.d.ts +3 -3
- package/dist/hot.js +2 -46
- package/dist/index.d.ts +329 -302
- package/dist/index.js +10566 -22552
- package/dist/{model-lod-CTpZ6imz.d.ts → model-lod-B6BMqS1r.d.ts} +33 -3
- package/dist/playtest.d.ts +3 -3
- package/dist/playtest.js +24 -75
- package/dist/react-css.js +1 -215
- package/dist/react.d.ts +2 -2
- package/dist/{renderer-rZm0hVqq.d.ts → renderer-DvFVoAgj.d.ts} +13 -4
- package/dist/spells/index.d.ts +643 -0
- package/dist/spells/index.js +1558 -0
- package/dist/spells/ultra/index.d.ts +1600 -0
- package/dist/spells/ultra/index.js +6804 -0
- package/dist/terrain-jobs-worker.js +1 -123
- package/dist/two-sided-foliage-W523J3UM.js +1 -0
- package/dist/ui-layer.js +5 -384
- package/dist/worker.js +4 -41
- package/dist/world.d.ts +725 -259
- package/dist/world.js +16714 -18284
- package/mcp/animation-server.mjs +1 -1
- package/mcp/animation.mjs +2 -3
- package/mcp/engine-server.mjs +142 -47
- package/mcp/servers.mjs +9 -2
- package/mcp/terrain.mjs +8 -0
- package/package.json +14 -6
- package/patches/three@0.187.0-prd269-upgrade.patch +2102 -0
- package/patches/three@0.187.0.patch +2004 -407
- package/src/assets.ts +9 -2
- package/src/card-lod.ts +152 -0
- package/src/compressed-texture-preparation.ts +1008 -0
- package/src/frame-budget.ts +31 -20
- package/src/game-dev-tools.ts +93 -0
- package/src/game-frame-loop.ts +995 -0
- package/src/game-renderer-metrics.ts +77 -0
- package/src/game-startup.ts +1001 -0
- package/src/game-validate.ts +70 -0
- package/src/game.ts +253 -1935
- package/src/index.ts +27 -2
- package/src/launch-diagnostics.ts +22 -12
- package/src/look/ao-admission.ts +24 -0
- package/src/look/filmic-tone-mapping.ts +15 -13
- package/src/look/look-diagnostics.ts +3 -3
- package/src/look/quality.ts +10 -5
- package/src/look/world-environment.ts +76 -9
- package/src/loop.ts +29 -0
- package/src/model-lod.ts +42 -3
- package/src/particle-kinds.ts +515 -0
- package/src/picking.ts +17 -3
- package/src/playtest.ts +27 -1
- package/src/projection-apply.ts +4 -1
- package/src/projection-plan.ts +9 -6
- package/src/render/mesh-pool.ts +1 -1
- package/src/render/resolution-subrect.ts +2 -0
- package/src/render/rough-diffuse.ts +46 -12
- package/src/render/soft-shadow.ts +27 -12
- package/src/render/virtual-shadow-adaptive.ts +55 -0
- package/src/render/virtual-shadow-casters.ts +175 -0
- package/src/render/virtual-shadow-layers.ts +76 -0
- package/src/render/virtual-shadow-level.ts +224 -0
- package/src/render/virtual-shadow-markers.ts +193 -0
- package/src/render/virtual-shadow-options.ts +370 -0
- package/src/render/virtual-shadow-pages.ts +5 -0
- package/src/render/virtual-shadow.ts +213 -992
- package/src/render/world-impostor-surface.ts +293 -34
- package/src/render-pass-budget.ts +34 -7
- package/src/renderProjection.ts +22 -0
- package/src/renderer.ts +92 -37
- package/src/snow-field.ts +1 -1
- package/src/spells/cast-pool.ts +361 -0
- package/src/spells/index.ts +177 -0
- package/src/spells/mechanisms.ts +295 -0
- package/src/spells/reaction-field.ts +415 -0
- package/src/spells/spell-lights.ts +139 -0
- package/src/spells/spell-world.ts +187 -0
- package/src/spells/spell.ts +397 -0
- package/src/spells/spells.ts +283 -0
- package/src/spells/ultra/engine/camera.ts +184 -0
- package/src/spells/ultra/engine/quality.ts +96 -0
- package/src/spells/ultra/index.ts +52 -0
- package/src/spells/ultra/main.ts +305 -0
- package/src/spells/ultra/scene/arenaMaterial.ts +325 -0
- package/src/spells/ultra/spells/cast.ts +233 -0
- package/src/spells/ultra/spells/fire.ts +1267 -0
- package/src/spells/ultra/vfx/FluidVolume.ts +816 -0
- package/src/spells/ultra/vfx/FluidVolume.tsl.ts +855 -0
- package/src/spells/ultra/vfx/FxTarget.ts +61 -0
- package/src/spells/ultra/vfx/GroundField.ts +1399 -0
- package/src/spells/ultra/vfx/Particles.ts +1475 -0
- package/src/spells/ultra/vfx/Ribbons.ts +645 -0
- package/src/spells/ultra/vfx/Shockwaves.ts +286 -0
- package/src/spells/ultra/vfx/Volumes.ts +489 -0
- package/src/spells/ultra/vfx/common.ts +1195 -0
- package/src/spells/ultra/vfx/noise.ts +441 -0
- package/src/startup-readiness.ts +128 -34
- package/src/version.ts +1 -1
- package/src/warmup.ts +56 -8
- package/src/water-surface.ts +9 -3
- package/src/world-bundle-safety.ts +401 -0
- package/src/world-cell-batches.ts +1216 -0
- package/src/world-cell-chunks.ts +1132 -0
- package/src/world-cell-data.ts +995 -0
- package/src/world-cell-impostors.ts +1449 -0
- package/src/world-cell-lod-bias.ts +151 -0
- package/src/world-cell-models.ts +1074 -0
- package/src/world-cell-options.ts +189 -0
- package/src/world-cell-placements.ts +694 -0
- package/src/world-cell-prewarm.ts +557 -0
- package/src/world-cell-readiness.ts +357 -0
- package/src/world-cell-render-bundles.ts +459 -0
- package/src/world-cell-render-gpu-dress.ts +714 -0
- package/src/world-cell-render-main-cull.ts +484 -0
- package/src/world-cell-render-shadow-claims.ts +198 -0
- package/src/world-cell-render-util.ts +246 -0
- package/src/world-cell-render.ts +1493 -0
- package/src/world-cell-residency.ts +745 -0
- package/src/world-cells.ts +1318 -10418
- package/src/world-chunk-shadow.ts +308 -0
- package/src/world-collar.ts +315 -0
- package/src/world-gpu-flags.ts +163 -0
- package/src/world-gpu-readback.ts +881 -0
- package/src/world-gpu-reference.ts +510 -0
- package/src/world-gpu-scene.ts +214 -2264
- package/src/world-gpu-shadow.ts +190 -0
- package/src/world-gpu-types.ts +381 -0
- package/src/world-gpu-validation.ts +518 -0
- package/src/world-heightfield.ts +802 -0
- package/src/world-load-limiter.ts +106 -0
- package/src/world-noise.ts +241 -0
- package/src/world-package.ts +42 -0
- package/src/world-region.ts +1 -1
- package/src/world-terrain-splat.ts +365 -149
- package/src/world-tile-budget.ts +256 -0
- package/src/world-tile-geometry.ts +469 -0
- package/src/world-tile-lod.ts +408 -0
- package/src/world-tile-observation.ts +566 -0
- package/src/world-tile-stitch.ts +166 -0
- package/src/world-tiles.ts +170 -1745
- package/src/world-water-bodies.ts +359 -0
- package/src/world.ts +35 -741
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { IRenderPerformanceMetrics } from "./loop.js";
|
|
2
|
+
import type { RendererKind } from "./renderer.js";
|
|
3
|
+
|
|
4
|
+
/** The measured draw count on its own, for the projection line that reads it every frame. */
|
|
5
|
+
export function rendererDrawCallCount(raw: unknown): number | undefined {
|
|
6
|
+
if (typeof raw !== "object" || raw === null) return undefined;
|
|
7
|
+
const info = (raw as { info?: unknown }).info;
|
|
8
|
+
if (typeof info !== "object" || info === null) return undefined;
|
|
9
|
+
const render = (info as { render?: unknown }).render;
|
|
10
|
+
if (typeof render !== "object" || render === null) return undefined;
|
|
11
|
+
const drawCalls = (render as { drawCalls?: unknown }).drawCalls;
|
|
12
|
+
const calls = drawCalls ?? (render as { calls?: unknown }).calls;
|
|
13
|
+
return typeof calls === "number" && Number.isFinite(calls) && calls >= 0 ? calls : undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function rendererPerformanceMetrics(raw: unknown): {
|
|
17
|
+
drawCalls?: number;
|
|
18
|
+
triangles?: number;
|
|
19
|
+
} {
|
|
20
|
+
if (typeof raw !== "object" || raw === null) return {};
|
|
21
|
+
const info = (raw as { info?: unknown }).info;
|
|
22
|
+
if (typeof info !== "object" || info === null) return {};
|
|
23
|
+
const render = (info as { render?: unknown }).render;
|
|
24
|
+
if (typeof render !== "object" || render === null) return {};
|
|
25
|
+
const triangles = (render as { triangles?: unknown }).triangles;
|
|
26
|
+
const drawCalls = rendererDrawCallCount(raw);
|
|
27
|
+
return {
|
|
28
|
+
...(drawCalls === undefined ? {} : { drawCalls }),
|
|
29
|
+
...(typeof triangles === "number" && Number.isFinite(triangles) && triangles >= 0
|
|
30
|
+
? { triangles }
|
|
31
|
+
: {}),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function resetRendererPerformanceMetrics(raw: unknown): void {
|
|
36
|
+
if (typeof raw !== "object" || raw === null) return;
|
|
37
|
+
const info = (raw as { info?: unknown }).info;
|
|
38
|
+
if (typeof info !== "object" || info === null) return;
|
|
39
|
+
const reset = (info as { reset?: unknown }).reset;
|
|
40
|
+
if (typeof reset === "function") reset.call(info);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* One frame's two render calls, combined.
|
|
45
|
+
*
|
|
46
|
+
* The two renderers' `info` do not mean the same thing, and the old sum only ever held for one of
|
|
47
|
+
* them. `WebGLRenderer` ends every `render()` with `info.reset()`, so the world sample and the
|
|
48
|
+
* overlay sample are disjoint and add up. WebGPU never resets: the engine owns the
|
|
49
|
+
* requestAnimationFrame loop, so it calls `info.reset()` itself once per frame before the world
|
|
50
|
+
* draw (see the render block), which leaves the overlay sample *cumulative* — world plus overlay.
|
|
51
|
+
* Adding it to the world sample reported every world draw twice, and the packed racing scenario
|
|
52
|
+
* read 358 draw calls against a 330 ceiling on a frame that submits far fewer.
|
|
53
|
+
*
|
|
54
|
+
* The world pass split belongs to the world call in both renderers and rides the same sample, so
|
|
55
|
+
* it is carried across rather than summed — a summed split attributes the world's shadow and
|
|
56
|
+
* reflection passes to the overlay too.
|
|
57
|
+
*/
|
|
58
|
+
export function combineRenderPerformanceMetrics(
|
|
59
|
+
kind: RendererKind,
|
|
60
|
+
world: IRenderPerformanceMetrics | undefined,
|
|
61
|
+
overlay: IRenderPerformanceMetrics,
|
|
62
|
+
): IRenderPerformanceMetrics {
|
|
63
|
+
const passes = world?.passes;
|
|
64
|
+
if (kind === "webgpu") {
|
|
65
|
+
return passes === undefined ? overlay : { ...overlay, passes };
|
|
66
|
+
}
|
|
67
|
+
if (world === undefined) return overlay;
|
|
68
|
+
return {
|
|
69
|
+
...(world.drawCalls === undefined || overlay.drawCalls === undefined
|
|
70
|
+
? {}
|
|
71
|
+
: { drawCalls: world.drawCalls + overlay.drawCalls }),
|
|
72
|
+
...(world.triangles === undefined || overlay.triangles === undefined
|
|
73
|
+
? {}
|
|
74
|
+
: { triangles: world.triangles + overlay.triangles }),
|
|
75
|
+
...(passes === undefined ? {} : { passes }),
|
|
76
|
+
};
|
|
77
|
+
}
|