@threenative/core 0.3.10 → 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 +10565 -22533
- 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-camera-cull.ts +32 -1
- 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,61 @@
|
|
|
1
|
+
// Ported from Ultra Elements src/vfx/FxTarget.js @698b720 (MIT, Copyright (c) 2026 Humpalumps). JavaScript copied verbatim; GLSL transliterated to TSL.
|
|
2
|
+
import { Group, Vector4 } from "three";
|
|
3
|
+
import { U } from "./common.js";
|
|
4
|
+
|
|
5
|
+
// The half-res FX pass (PLAN 2.5 "FX target"): one MRT with one blend state for every soft
|
|
6
|
+
// translucent thing (media, volumes, glows, distortion), never sorted (weighted-blended OIT).
|
|
7
|
+
// 1. depth prepass: the FX depth buffer gets the FARTHEST full-res depth of each footprint, so
|
|
8
|
+
// nothing in front of the background is rejected at silhouettes
|
|
9
|
+
// 2. the fx scene draws into (media, weight + distortion, emission)
|
|
10
|
+
// 3. composite at full res: nearest-depth upsample (a full-res pixel nearer than every FX tap
|
|
11
|
+
// rejects FX, which kills halos at pillar edges), distortion with distortion-driven chromatic
|
|
12
|
+
// aberration, the WBOIT resolve, emission, the void's negative shell, and debug views.
|
|
13
|
+
//
|
|
14
|
+
// Engine (ThreeNative's C++ engine over WebGPU) differences, each forced:
|
|
15
|
+
// - a RenderTarget has one colour texture (no MRT) and materials blend only None/Normal/Additive
|
|
16
|
+
// (no CustomBlending), so the three-attachment WBOIT accumulation cannot be built;
|
|
17
|
+
// - an offscreen pass (PassNode) draws before the frame's scene pass, so the FX could not read this
|
|
18
|
+
// frame's depth for the prepass, soft fades and the march end, and the post graph
|
|
19
|
+
// (WorldEnvironment's baseColour) can composite textures but cannot draw meshes.
|
|
20
|
+
// So `scene` is a Group the game adds to its world scene: FX materials draw in the frame's transparent
|
|
21
|
+
// queue (back to front), read viewportDepthTexture() for the depth, and fxOut() writes the
|
|
22
|
+
// composite of each layer through NormalBlending (common.ts, FX_BLENDING). Upstream's half-res
|
|
23
|
+
// target only sets the volume step counts here (uFxResolution), as upstream's step rule reads it.
|
|
24
|
+
// Open: distortion + CA (wt.gb) and the void's invert shell need a material reading
|
|
25
|
+
// viewportSharedTexture(); the debug views are not ported.
|
|
26
|
+
export const DEBUG_VIEWS = {
|
|
27
|
+
off: 0,
|
|
28
|
+
overdraw: 1,
|
|
29
|
+
emission: 2,
|
|
30
|
+
media: 3,
|
|
31
|
+
distortion: 4,
|
|
32
|
+
"ground A": 5,
|
|
33
|
+
"ground B": 6,
|
|
34
|
+
particles: 7,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export class FxTarget {
|
|
38
|
+
readonly scene = new Group(); // upstream's scenes.fx: add once to the world scene
|
|
39
|
+
readonly params = { smokeOccludesGlow: 0.5, distortion: 1, ca: 0.35 };
|
|
40
|
+
readonly invert = new Vector4();
|
|
41
|
+
readonly ratio = { x: 2, y: 2 };
|
|
42
|
+
|
|
43
|
+
constructor() {
|
|
44
|
+
this.scene.name = "ultra-fx";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
setSize(w: number, h: number, scale: number): void {
|
|
48
|
+
const fw = Math.max(1, Math.ceil(w * scale));
|
|
49
|
+
const fh = Math.max(1, Math.ceil(h * scale));
|
|
50
|
+
this.ratio.x = w / fw;
|
|
51
|
+
this.ratio.y = h / fh;
|
|
52
|
+
U.uResolution.value.set(w, h);
|
|
53
|
+
U.uFxResolution.value.set(fw, fh);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// upstream draws the fx scene and composites here; on the engine the frame's own draw does both,
|
|
57
|
+
// so render() only publishes the composite parameters fxOut() reads
|
|
58
|
+
render(): void {
|
|
59
|
+
U.uFxParams.value.set(this.params.smokeOccludesGlow, this.params.distortion, this.params.ca, 0);
|
|
60
|
+
}
|
|
61
|
+
}
|