create-threenative 0.2.18 → 0.2.21
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/agent-docs/references/assertion-reference.md +1 -1
- package/agent-docs/references/capability-reference.md +792 -5
- package/agent-docs/references/kit-racing.md +4 -2
- package/agent-docs/references/performance-basics.md +2 -1
- package/agent-docs/references/terrain-authoring.md +25 -7
- package/agent-files/.agents/skills/prd-creator/SKILL.md +24 -0
- package/dist/index.js +268 -237
- package/dist/quality.d.ts +5 -1
- package/dist/quality.js +75 -6
- package/dist/terrain-kit.js +1 -1
- package/dist/threenative.js +7 -5
- package/dist/web-engine-post-effects.js +6 -0
- package/dist/web-engine-runtime.js +407 -38
- package/package.json +6 -6
- package/template-assets/assets/floor-fern-0.glb +0 -0
- package/template-assets/assets/floor-litter-0.glb +0 -0
- package/template-assets/assets/floor-log-0.glb +0 -0
- package/template-assets/assets/floor-log-1.glb +0 -0
- package/template-assets/assets/floor-stump-0.glb +0 -0
- package/template-assets/assets/floor-twig-0.glb +0 -0
- package/template-assets/patches/three@0.187.0.patch +108 -21
- package/template-assets/quality/eslint.config.js +1 -1
- package/templates/action-rpg/package.json +7 -7
- package/templates/action-rpg/src/loot/drops.ts +3 -7
- package/templates/action-rpg/src/render/camera.ts +2 -2
- package/templates/action-rpg/src/render/clouds.ts +3 -1
- package/templates/action-rpg/src/render/materials.ts +3 -2
- package/templates/action-rpg/src/render/touch-controls.ts +7 -6
- package/templates/action-rpg/src/scenes/Play.ts +1 -15
- package/templates/adventure/AGENTS.md +3 -3
- package/templates/adventure/CLAUDE.md +3 -3
- package/templates/adventure/native-playtests/survives.playtest.json +12 -0
- package/templates/adventure/native-playtests/woodland-floor.playtest.json +61 -0
- package/templates/adventure/package.json +7 -7
- package/templates/adventure/playtests/grass.playtest.json +61 -0
- package/templates/adventure/playtests/performance.playtest.json +1 -1
- package/templates/adventure/playtests/survives.playtest.json +2 -2
- package/templates/adventure/playtests/woodland-floor.playtest.json +61 -0
- package/templates/adventure/src/entities/LockOn.ts +42 -4
- package/templates/adventure/src/entities/Warden.ts +12 -3
- package/templates/adventure/src/level/Vale.ts +241 -16
- package/templates/adventure/src/render/camera.ts +2 -2
- package/templates/adventure/src/render/foliage.ts +64 -20
- package/templates/adventure/src/render/grass.ts +325 -0
- package/templates/adventure/src/render/materials.ts +3 -2
- package/templates/adventure/src/render/palette.ts +3 -0
- package/templates/adventure/src/render/touch-controls.ts +4 -1
- package/templates/adventure/src/scenes/Play.ts +96 -1
- package/templates/collectathon/package.json +7 -7
- package/templates/collectathon/src/level/Course.ts +2 -7
- package/templates/collectathon/src/level/terrain.ts +2 -1
- package/templates/collectathon/src/render/camera.ts +2 -2
- package/templates/collectathon/src/render/ground.ts +4 -4
- package/templates/collectathon/src/render/hero.ts +1 -1
- package/templates/collectathon/src/render/materials.ts +0 -1
- package/templates/collectathon/src/render/sky.ts +4 -3
- package/templates/kart/package.json +6 -6
- package/templates/kart/src/entities/Kart.ts +2 -1
- package/templates/kart/src/render/course.ts +2 -1
- package/templates/kart/src/track/Course.ts +3 -1
- package/templates/minimal/package.json +6 -6
- package/templates/minimal/src/render/camera.ts +2 -2
- package/templates/minimal/src/render/clouds.ts +3 -1
- package/templates/minimal/src/render/materials.ts +3 -2
- package/templates/minimal/src/render/touch-controls.ts +7 -6
- package/templates/platformer/package.json +7 -7
- package/templates/platformer/playtests/collect.playtest.json +4 -1
- package/templates/platformer/src/level/Stage.ts +2 -6
- package/templates/platformer/src/scenes/Play.ts +2 -1
- package/templates/puzzle/package.json +7 -7
- package/templates/puzzle/src/entities/Warden.ts +3 -3
- package/templates/puzzle/src/render/camera.ts +2 -2
- package/templates/puzzle/src/render/touch-controls.ts +7 -6
- package/templates/racing/AGENTS.md +2 -2
- package/templates/racing/CLAUDE.md +2 -2
- package/templates/racing/CREDITS.md +29 -0
- package/templates/racing/assets/engine-loop.wav +0 -0
- package/templates/racing/assets/grass/Grass004_color.jpg +0 -0
- package/templates/racing/assets/grass/Grass004_normal.jpg +0 -0
- package/templates/racing/assets/grass/Grass004_roughness.jpg +0 -0
- package/templates/racing/assets/nitro-burst.wav +0 -0
- package/templates/racing/assets/tyre-squeal.wav +0 -0
- package/templates/racing/package.json +7 -7
- package/templates/racing/playtests/drift-natural.playtest.json +68 -0
- package/templates/racing/playtests/drift.playtest.json +100 -0
- package/templates/racing/playtests/hud.playtest.json +117 -0
- package/templates/racing/playtests/launch-pose.playtest.json +34 -0
- package/templates/racing/playtests/nitro.playtest.json +158 -0
- package/templates/racing/playtests/outcome.playtest.json +4 -4
- package/templates/racing/playtests/performance.playtest.json +1 -1
- package/templates/racing/playtests/steady-camera.playtest.json +88 -0
- package/templates/racing/src/audio/engine.ts +138 -0
- package/templates/racing/src/entities/CarBody.ts +83 -10
- package/templates/racing/src/entities/Drift.ts +243 -0
- package/templates/racing/src/entities/LineDriver.ts +2 -2
- package/templates/racing/src/entities/Nitro.ts +72 -0
- package/templates/racing/src/entities/RacingCar.ts +86 -21
- package/templates/racing/src/entities/Rival.ts +35 -21
- package/templates/racing/src/game.ts +6 -0
- package/templates/racing/src/gauges.ts +74 -0
- package/templates/racing/src/render/camera.ts +29 -4
- package/templates/racing/src/render/clouds.ts +3 -1
- package/templates/racing/src/render/effects.ts +244 -0
- package/templates/racing/src/render/materials.ts +43 -8
- package/templates/racing/src/render/shapes.ts +37 -0
- package/templates/racing/src/render/skids.ts +84 -0
- package/templates/racing/src/render/touch-controls.ts +10 -10
- package/templates/racing/src/scenes/Race.ts +277 -25
- package/templates/racing/src/state.ts +35 -0
- package/templates/racing/src/style.css +3 -0
- package/templates/racing/src/track/Ranking.ts +8 -4
- package/templates/racing/src/track/Track.ts +132 -58
- package/templates/racing/src/track/TrackSector.ts +19 -1
- package/templates/racing/src/track/circuit.ts +21 -15
- package/templates/racing/src/ui/GameUi.tsx +0 -2
- package/templates/racing/src/ui/Hud.tsx +417 -50
- package/templates/racing/threenative.config.ts +15 -0
- package/templates/racing/tools/make-racing-audio.mjs +388 -0
- package/templates/rain/package.json +6 -6
- package/templates/rain/src/render/noise-volume.ts +2 -1
- package/templates/rain/src/state.ts +3 -1
- package/templates/rain/src/ui/GameUi.tsx +1 -1
- package/templates/rain/src/ui/automation.ts +10 -8
- package/templates/rain/src/ui/tempest.ts +3 -4
- package/templates/rts/package.json +6 -6
- package/templates/rts/src/sim/terrain.ts +1 -0
- package/templates/rts/src/sim/types.ts +1 -0
- package/templates/runner/package.json +7 -7
- package/templates/runner/src/render/clouds.ts +3 -1
- package/templates/runner/src/render/materials.ts +3 -2
- package/templates/runner/src/render/touch-controls.ts +7 -6
- package/templates/runner/src/scenes/Run.ts +4 -9
- package/templates/sailing/package.json +7 -7
- package/templates/sailing/src/render/touch-controls.ts +7 -6
- package/templates/shooter/package.json +7 -7
- package/templates/shooter/src/render/clouds.ts +3 -1
- package/templates/snow/package.json +7 -7
- package/templates/snow/src/entities/Explorer.ts +6 -12
- package/templates/snow/src/render/bootPrint.ts +3 -1
- package/templates/snow/src/render/camera.ts +3 -2
- package/templates/snow/src/render/scenery.ts +3 -3
- package/templates/snow/src/render/touch-controls.ts +7 -6
- package/templates/snow/src/render/weather.ts +3 -5
- package/templates/snow/src/terrain.ts +2 -1
- package/templates/starter/native-playtests/render-chain.playtest.json +9 -9
- package/templates/starter/package.json +7 -7
- package/templates/starter/src/entities/Player.ts +10 -2
- package/templates/starter/src/render/camera.ts +2 -2
- package/templates/starter/src/render/clouds.ts +3 -1
- package/templates/starter/src/render/materials.ts +3 -2
- package/templates/starter/src/render/touch-controls.ts +7 -6
- package/templates/starter/src/scenes/Play.ts +1 -14
- package/templates/tower-defense/package.json +7 -7
- package/templates/tower-defense/src/render/shapes.ts +1 -2
- package/templates/tower-defense/src/scenes/Battle.ts +3 -8
- package/template-assets/terrain/alpine/assets.json +0 -12
- package/template-assets/terrain/alpine/bake.mjs +0 -6
- package/template-assets/terrain/alpine/credits.json +0 -164
- package/template-assets/terrain/alpine/heightmap.r16 +0 -0
- package/template-assets/terrain/alpine/recipe.json +0 -119
- package/template-assets/terrain/alpine/surface.json +0 -53
- package/template-assets/terrain/coastal/assets.json +0 -11
- package/template-assets/terrain/coastal/bake.mjs +0 -6
- package/template-assets/terrain/coastal/credits.json +0 -117
- package/template-assets/terrain/coastal/heightmap.r16 +0 -0
- package/template-assets/terrain/coastal/recipe.json +0 -113
- package/template-assets/terrain/coastal/surface.json +0 -41
- package/template-assets/terrain/desert/assets.json +0 -12
- package/template-assets/terrain/desert/bake.mjs +0 -6
- package/template-assets/terrain/desert/credits.json +0 -164
- package/template-assets/terrain/desert/heightmap.r16 +0 -0
- package/template-assets/terrain/desert/recipe.json +0 -108
- package/template-assets/terrain/desert/surface.json +0 -54
- package/template-assets/terrain/forest/assets.json +0 -65
- package/template-assets/terrain/forest/bake.mjs +0 -8
- package/template-assets/terrain/forest/credits.json +0 -225
- package/template-assets/terrain/forest/heightmap.r16 +0 -0
- package/template-assets/terrain/forest/recipe.json +0 -350
- package/template-assets/terrain/forest/surface.json +0 -79
- package/template-assets/terrain/tundra/assets.json +0 -12
- package/template-assets/terrain/tundra/bake.mjs +0 -6
- package/template-assets/terrain/tundra/credits.json +0 -164
- package/template-assets/terrain/tundra/heightmap.r16 +0 -0
- package/template-assets/terrain/tundra/recipe.json +0 -277
- package/template-assets/terrain/tundra/surface.json +0 -54
- package/templates/racing/src/ui/Menu.tsx +0 -7
package/dist/quality.js
CHANGED
|
@@ -166368,6 +166368,7 @@ var import_parser = __toESM(require_dist9());
|
|
|
166368
166368
|
|
|
166369
166369
|
// src/quality/hotCallbacks.ts
|
|
166370
166370
|
var FRAME_METHODS = /* @__PURE__ */ new Set(["render", "update"]);
|
|
166371
|
+
var ENTITY_FRAME_METHODS = /* @__PURE__ */ new Set(["fixedUpdate", "step", "tick", "update"]);
|
|
166371
166372
|
var FRAME_HOOKS = /* @__PURE__ */ new Map([
|
|
166372
166373
|
["afterPhysics", "ctx.afterPhysics"],
|
|
166373
166374
|
["beforeRender", "ctx.beforeRender"],
|
|
@@ -166402,16 +166403,25 @@ function hookName(parent, node) {
|
|
|
166402
166403
|
const name = calleeMember(parent, node);
|
|
166403
166404
|
return name === void 0 ? void 0 : FRAME_HOOKS.get(name);
|
|
166404
166405
|
}
|
|
166406
|
+
function methodLabel(parent, sceneLocals) {
|
|
166407
|
+
if (parent.type !== "MethodDefinition" || parent.static || parent.key.type !== "Identifier")
|
|
166408
|
+
return void 0;
|
|
166409
|
+
const owner = parent.parent?.parent ?? void 0;
|
|
166410
|
+
const base = owner?.superClass;
|
|
166411
|
+
const isSceneBase = base?.type === "Identifier" && sceneLocals.has(base.name);
|
|
166412
|
+
if (isSceneBase)
|
|
166413
|
+
return FRAME_METHODS.has(parent.key.name) ? `Scene.${parent.key.name}` : void 0;
|
|
166414
|
+
if (!ENTITY_FRAME_METHODS.has(parent.key.name)) return void 0;
|
|
166415
|
+
const className2 = owner?.id?.name;
|
|
166416
|
+
return className2 === void 0 ? parent.key.name : `${className2}.${parent.key.name}`;
|
|
166417
|
+
}
|
|
166405
166418
|
function trackHotCallbacks() {
|
|
166406
166419
|
const sceneLocals = /* @__PURE__ */ new Set();
|
|
166407
166420
|
const frames = [];
|
|
166408
166421
|
const frameName = (node) => {
|
|
166409
166422
|
const parent = node.parent;
|
|
166410
|
-
|
|
166411
|
-
|
|
166412
|
-
const isSceneBase = base?.type === "Identifier" && sceneLocals.has(base.name);
|
|
166413
|
-
if (isSceneBase && FRAME_METHODS.has(parent.key.name)) return `Scene.${parent.key.name}`;
|
|
166414
|
-
}
|
|
166423
|
+
const method = methodLabel(parent, sceneLocals);
|
|
166424
|
+
if (method !== void 0) return method;
|
|
166415
166425
|
const hook = hookName(parent, node);
|
|
166416
166426
|
if (hook !== void 0) return hook;
|
|
166417
166427
|
const member = calleeMember(parent, node);
|
|
@@ -166634,6 +166644,64 @@ var threenativePlugin = {
|
|
|
166634
166644
|
}
|
|
166635
166645
|
};
|
|
166636
166646
|
|
|
166647
|
+
// src/quality/reinventions.ts
|
|
166648
|
+
var PRNG_OUTSIDE = ["src/audio.ts", "src/audio/**", "src/render/**", "src/ui/**"];
|
|
166649
|
+
var REINVENTIONS = [
|
|
166650
|
+
{
|
|
166651
|
+
selector: ':matches(CallExpression[callee.object.name="Math"][callee.property.name="random"], Literal[value=1664525], Literal[value=1013904223], Literal[value=1831565813])',
|
|
166652
|
+
capability: "createRandom",
|
|
166653
|
+
source: "core",
|
|
166654
|
+
outside: PRNG_OUTSIDE,
|
|
166655
|
+
message: "A hand-written PRNG (Math.random or the LCG constants) is a capability the engine ships: use `createRandom(seed)` from `@threenative/core`, or `ctx.random`, so the same seed replays the same game."
|
|
166656
|
+
},
|
|
166657
|
+
{
|
|
166658
|
+
selector: 'BinaryExpression[operator="-"][left.value=1][right.callee.object.name="Math"][right.callee.property.name="exp"]',
|
|
166659
|
+
capability: "MathUtils.damp",
|
|
166660
|
+
source: "three",
|
|
166661
|
+
message: "`1 - Math.exp(-\u2026)` is a damp factor the engine ships: use `MathUtils.damp(current, target, rate, dt)` from `three`, which is the same curve with the rate named."
|
|
166662
|
+
},
|
|
166663
|
+
{
|
|
166664
|
+
selector: ':matches(MemberExpression[object.name="location"][property.name="search"], MemberExpression[object.property.name="location"][property.name="search"])',
|
|
166665
|
+
capability: "debugFlag",
|
|
166666
|
+
source: "core",
|
|
166667
|
+
message: "Reading `location.search` by hand is a launch seam the engine owns: use `debugFlag(name)` or `debugValue(name)` from `@threenative/core` (`?name` on web, `TN_DEBUG_NAME` on native)."
|
|
166668
|
+
},
|
|
166669
|
+
{
|
|
166670
|
+
selector: 'AssignmentExpression[left.property.name="matrixWorldAutoUpdate"][right.value=false]',
|
|
166671
|
+
capability: "renderer.matrixWorld",
|
|
166672
|
+
source: "core",
|
|
166673
|
+
message: "Turning `matrixWorldAutoUpdate` off by hand is the engine's own walk: set `renderer.matrixWorld` in the game config for a whole scene, or `markStatic(node)` for one node that never moves."
|
|
166674
|
+
},
|
|
166675
|
+
{
|
|
166676
|
+
selector: 'BinaryExpression[operator="-"][left.type="ConditionalExpression"][left.consequent.value=1][left.alternate.value=0][right.type="ConditionalExpression"][right.consequent.value=1][right.alternate.value=0]',
|
|
166677
|
+
capability: "InputMap.axis",
|
|
166678
|
+
source: "core",
|
|
166679
|
+
message: "An axis built from raw keys is a binding the engine already reads: declare it in `defineGame({ input })` and use `ctx.input.axis(name)` from `@threenative/core`."
|
|
166680
|
+
},
|
|
166681
|
+
{
|
|
166682
|
+
selector: 'BinaryExpression[operator="*"][right.type="BinaryExpression"][right.operator="-"][right.left.value=3][right.right.type="BinaryExpression"][right.right.operator="*"][right.right.left.value=2]',
|
|
166683
|
+
capability: "MathUtils.smoothstep",
|
|
166684
|
+
source: "three",
|
|
166685
|
+
message: "`x * x * (3 - 2 * x)` is the engine's smoothstep: use `MathUtils.smoothstep(x, 0, 1)` from `three`, which clamps the same way."
|
|
166686
|
+
}
|
|
166687
|
+
];
|
|
166688
|
+
function reinventionRules(rows) {
|
|
166689
|
+
return {
|
|
166690
|
+
"no-restricted-syntax": [
|
|
166691
|
+
"error",
|
|
166692
|
+
...rows.map(({ selector, message }) => ({ selector, message }))
|
|
166693
|
+
]
|
|
166694
|
+
};
|
|
166695
|
+
}
|
|
166696
|
+
function reinventionConfigs(files) {
|
|
166697
|
+
const always = REINVENTIONS.filter((row) => row.outside === void 0);
|
|
166698
|
+
const ignores = [...new Set(REINVENTIONS.flatMap((row) => row.outside ?? []))];
|
|
166699
|
+
return [
|
|
166700
|
+
{ files: [...files], rules: reinventionRules(always) },
|
|
166701
|
+
{ files: [...files], ignores, rules: reinventionRules(REINVENTIONS) }
|
|
166702
|
+
];
|
|
166703
|
+
}
|
|
166704
|
+
|
|
166637
166705
|
// src/quality/index.ts
|
|
166638
166706
|
var asPlugin = (plugin) => plugin;
|
|
166639
166707
|
var SOURCE = ["src/**/*.ts", "src/**/*.tsx"];
|
|
@@ -166641,7 +166709,7 @@ function hasReact(root) {
|
|
|
166641
166709
|
const manifest = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8"));
|
|
166642
166710
|
return ["dependencies", "devDependencies"].some((field) => manifest[field]?.react !== void 0);
|
|
166643
166711
|
}
|
|
166644
|
-
function qualityConfig({ root }) {
|
|
166712
|
+
function qualityConfig({ root, reinventions = false }) {
|
|
166645
166713
|
const config = [
|
|
166646
166714
|
{ ignores: ["**/node_modules/**", "**/dist/**", "**/.threenative/**", "**/dist-native/**"] },
|
|
166647
166715
|
{
|
|
@@ -166675,6 +166743,7 @@ function qualityConfig({ root }) {
|
|
|
166675
166743
|
}
|
|
166676
166744
|
}
|
|
166677
166745
|
];
|
|
166746
|
+
if (reinventions) config.push(...reinventionConfigs(SOURCE));
|
|
166678
166747
|
if (hasReact(root)) {
|
|
166679
166748
|
config.push({
|
|
166680
166749
|
files: ["src/**/*.tsx"],
|
package/dist/terrain-kit.js
CHANGED
|
@@ -4,7 +4,7 @@ import path from 'path';
|
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
7
|
-
var KITS = ["alpine", "coastal", "desert", "
|
|
7
|
+
var KITS = ["alpine", "coastal", "desert", "tundra"];
|
|
8
8
|
var COPIED = [
|
|
9
9
|
"assets.json",
|
|
10
10
|
"bake.mjs",
|
package/dist/threenative.js
CHANGED
|
@@ -2708,6 +2708,8 @@ async function buildEngineDesktop(cwd, config, entry) {
|
|
|
2708
2708
|
config.window.title,
|
|
2709
2709
|
"--priority",
|
|
2710
2710
|
config.display.priority,
|
|
2711
|
+
"--fullscreen",
|
|
2712
|
+
String(config.display.fullscreen),
|
|
2711
2713
|
"--output",
|
|
2712
2714
|
output
|
|
2713
2715
|
]);
|
|
@@ -3267,11 +3269,11 @@ var MCP_SERVERS = Object.freeze({
|
|
|
3267
3269
|
})
|
|
3268
3270
|
});
|
|
3269
3271
|
var MCP_PACKAGES = Object.freeze({
|
|
3270
|
-
assets: Object.freeze({ name: "threenative-asset-mcp", version: "0.
|
|
3271
|
-
terrain: Object.freeze({ name: "@threenative/terrain", version: "0.1.
|
|
3272
|
+
assets: Object.freeze({ name: "threenative-asset-mcp", version: "0.17.0" }),
|
|
3273
|
+
terrain: Object.freeze({ name: "@threenative/terrain", version: "0.1.12" }),
|
|
3272
3274
|
sculpt: Object.freeze({ name: "threenative-sculpt-mcp", version: "0.2.2" }),
|
|
3273
|
-
engine: Object.freeze({ name: "threenative-engine-mcp", version: "0.2.
|
|
3274
|
-
animation: Object.freeze({ name: "threenative-animation-mcp", version: "0.1.
|
|
3275
|
+
engine: Object.freeze({ name: "threenative-engine-mcp", version: "0.2.16" }),
|
|
3276
|
+
animation: Object.freeze({ name: "threenative-animation-mcp", version: "0.1.13" }),
|
|
3275
3277
|
// `args` fixes the launch for every host. The Chrome flags are `WEBGPU_BROWSER_ARGS` from
|
|
3276
3278
|
// `@threenative/playtest`, so a DevTools trace profiles the same adapter a playtest does and not
|
|
3277
3279
|
// SwiftShader. An isolated profile keeps the user's own Chrome profile out, and the two opt-outs
|
|
@@ -3385,7 +3387,7 @@ var MCP_HOSTS = Object.freeze([
|
|
|
3385
3387
|
]);
|
|
3386
3388
|
|
|
3387
3389
|
// ../core/src/version.ts
|
|
3388
|
-
var CORE_VERSION = "0.3.
|
|
3390
|
+
var CORE_VERSION = "0.3.16";
|
|
3389
3391
|
|
|
3390
3392
|
// src/mcp-servers.ts
|
|
3391
3393
|
var CORE_PACKAGE_NAME = "@threenative/core";
|
|
@@ -616,6 +616,9 @@ function defineScreenSpaceGi(tsl) {
|
|
|
616
616
|
const fallback = options.fallback?.(position, direction, normal) ?? vec3(0, 0, 0);
|
|
617
617
|
gathered.assign(gathered.add(hit.radiance.sub(fallback).mul(hit.weight)));
|
|
618
618
|
hits.assign(hits.add(hit.weight));
|
|
619
|
+
}).Else(() => {
|
|
620
|
+
const past = options.miss?.(position, direction, normal);
|
|
621
|
+
if (past !== void 0) gathered.assign(gathered.add(past));
|
|
619
622
|
});
|
|
620
623
|
}
|
|
621
624
|
);
|
|
@@ -715,6 +718,9 @@ function defineScreenProbes(tsl, input) {
|
|
|
715
718
|
const hit = shade(trace.hitCoordinate, trace.hitDistance, direction);
|
|
716
719
|
const believed = options.fallback?.(position, direction, normal) ?? vec3(0, 0, 0);
|
|
717
720
|
result.assign(vec4(hit.radiance.sub(believed).mul(hit.weight), hit.weight));
|
|
721
|
+
}).Else(() => {
|
|
722
|
+
const past = options.miss?.(position, direction, normal);
|
|
723
|
+
if (past !== void 0) result.assign(vec4(past, 0));
|
|
718
724
|
});
|
|
719
725
|
});
|
|
720
726
|
return result;
|