incanto 0.14.0 → 0.16.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.
Files changed (29) hide show
  1. package/dist/3d.d.ts +34 -0
  2. package/dist/3d.js +3 -3
  3. package/dist/{create-game-OSntcIiM.js → create-game-B5GWzy1E.js} +2 -109
  4. package/dist/index.js +1 -1
  5. package/dist/{physics-3d-D_kUdOjr.js → physics-3d-CDlvC9Z_.js} +1 -1
  6. package/dist/react.js +1 -1
  7. package/dist/{register-C9-16x_t.js → register-Lp2qn1Wq.js} +435 -37
  8. package/dist/test.js +3 -3
  9. package/editor/assets/{agent8-BDC4LhjC.js → agent8-Cw7igxDG.js} +1 -1
  10. package/editor/assets/{index-7qOYg7t8.js → index-N3Hnrv0w.js} +217 -118
  11. package/editor/index.html +1 -1
  12. package/package.json +1 -1
  13. package/schemas/scene.schema.json +25 -0
  14. package/skills/incanto-environment.md +14 -2
  15. package/skills/incanto-node-reference.md +6 -0
  16. package/templates-app/beacon-isle-3d/PROJECT/Status.md +1 -1
  17. package/templates-app/beacon-isle-3d/generate-world.ts +23 -18
  18. package/templates-app/beacon-isle-3d/package.json +1 -1
  19. package/templates-app/beacon-isle-3d/src/behaviors.ts +70 -4
  20. package/templates-app/beacon-isle-3d/src/game.scene.json +20 -21
  21. package/templates-app/tps-3d/package.json +1 -1
  22. package/templates-app/village-quest-3d/PROJECT/Context.md +1 -1
  23. package/templates-app/village-quest-3d/PROJECT/Requirements.md +1 -1
  24. package/templates-app/village-quest-3d/PROJECT/Structure.md +6 -1
  25. package/templates-app/village-quest-3d/generate-dressing.ts +769 -0
  26. package/templates-app/village-quest-3d/package.json +1 -1
  27. package/templates-app/village-quest-3d/src/behaviors.ts +74 -8
  28. package/templates-app/village-quest-3d/src/grove.scene.json +1 -13
  29. package/templates-app/village-quest-3d/src/village.scene.json +2989 -162
package/dist/3d.d.ts CHANGED
@@ -2043,6 +2043,40 @@ declare class Water3D extends Node3D implements RenderHook3D, SunConsumer3D {
2043
2043
  * `{ color?, visibility? }` overrides the fog hue / view distance (meters).
2044
2044
  */
2045
2045
  underwater: boolean | JsonObject;
2046
+ /**
2047
+ * Directional traveling SWELL amplitude in meters (fancy only; 0 = off, the
2048
+ * legacy isotropic look). Three peaked wave trains march across the surface
2049
+ * at real deep-water speeds — THE open-ocean dial: 0.15 = lively lake chop,
2050
+ * 0.4 = coastal sea, 0.8 = heavy weather. Crests feed the color ramp,
2051
+ * `whitecaps` and the shore foam automatically.
2052
+ */
2053
+ swell: number;
2054
+ /** Compass direction the swell TRAVELS toward, degrees (0 = +z, 90 = +x). */
2055
+ swellDirectionDeg: number;
2056
+ /** Primary swell wavelength in meters (the two crossing trains derive). */
2057
+ swellWavelength: number;
2058
+ /** Open-water whitecap foam on the tallest crests, 0–1 (fancy only). Works
2059
+ * best with `swell` — the caps ride the swell's crest lines. */
2060
+ whitecaps: number;
2061
+ /**
2062
+ * THE one-choice water type: 'ocean' | 'pool' | 'lake' | 'pond' bundles
2063
+ * every wave/color/clarity/caustics knob into a hand-tuned sea state
2064
+ * ('custom', the default, changes nothing). A preset value applies ONLY
2065
+ * where a prop still sits at its schema default — set the type first, then
2066
+ * override any detail prop to taste and your value wins.
2067
+ */
2068
+ preset: string;
2069
+ /**
2070
+ * Above-water CAUSTICS intensity (0 = off): the dancing light web on the
2071
+ * submerged bottom, seen THROUGH the surface — the pool / tropical-shallows
2072
+ * look. Needs `refraction` (fancy quality). Presets set it; override freely.
2073
+ */
2074
+ causticsAbove: number;
2075
+ /** Preset-layered prop read (see {@link WATER_PRESETS}): the preset value
2076
+ * applies only while the prop sits at its schema default. */
2077
+ private rp;
2078
+ /** Per-preset internal look constants (fresnel curve, reflection ceiling). */
2079
+ private presetLook;
2046
2080
  /** Loader hook: degenerate planes and bad enums fail at LOAD, not at render. */
2047
2081
  static validateJson(node: Node): void;
2048
2082
  private time;
package/dist/3d.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { t as IncantoError } from "./errors-BpWbnbb_.js";
2
- import { a as Environment3D, c as sunDirectionFromElevationAzimuth, i as syncTree, l as sunDirectionFromSky, o as horizonColorFromSky, r as Renderer3D, s as parseEnvironment3D, t as createGame3D, u as AssetStore3D } from "./create-game-OSntcIiM.js";
3
- import { A as Area3D, B as movementState, C as BoneAttachment3D, D as TERRAIN_THEMES, E as DEFAULT_TERRAIN_TEXTURE_BASE, F as Node3D, L as QUARTER_PITCH, M as PhysicsBody3D, N as RigidBody3D, O as terrainThemeLayers, P as StaticBody3D, R as cameraRelative, S as BoneLookAt3D, T as Terrain3D, V as rigPose, _ as Flowers3D, a as VoxelGrid3D, b as CharacterController3D, c as Particles3D, d as DirectionalLight3D, f as OmniLight3D, g as DENSITY_PRESETS, h as Foliage3D, i as VOXEL_PALETTE, j as CharacterBody3D, k as Joint3D, l as ModelInstance3D, m as MeshInstance3D, n as Water3D, o as Tree3D, p as InstancedMesh3D, r as WATER_MAX_RIPPLES, s as Trail3D, t as registerNodes3D, u as LoftMesh3D, v as resolveFlowerDensity, w as Billboard3D, x as Camera3D, y as FLOWER_VARIETIES, z as keyboardIntensity } from "./register-C9-16x_t.js";
2
+ import { a as Environment3D, c as sunDirectionFromElevationAzimuth, i as syncTree, l as sunDirectionFromSky, o as horizonColorFromSky, r as Renderer3D, s as parseEnvironment3D, t as createGame3D, u as AssetStore3D } from "./create-game-B5GWzy1E.js";
3
+ import { A as Joint3D, B as keyboardIntensity, C as BoneLookAt3D, D as DEFAULT_TERRAIN_TEXTURE_BASE, E as Terrain3D, F as StaticBody3D, H as rigPose, I as Node3D, M as CharacterBody3D, N as PhysicsBody3D, O as TERRAIN_THEMES, P as RigidBody3D, R as QUARTER_PITCH, S as Camera3D, T as Billboard3D, V as movementState, _ as DENSITY_PRESETS, a as VOXEL_PALETTE, b as FLOWER_VARIETIES, c as Trail3D, d as LoftMesh3D, f as DirectionalLight3D, g as Foliage3D, h as MeshInstance3D, i as WATER_MAX_RIPPLES, j as Area3D, k as terrainThemeLayers, l as Particles3D, m as InstancedMesh3D, n as Water3D, o as VoxelGrid3D, p as OmniLight3D, s as Tree3D, t as registerNodes3D, u as ModelInstance3D, v as Flowers3D, w as BoneAttachment3D, x as CharacterController3D, y as resolveFlowerDensity, z as cameraRelative } from "./register-Lp2qn1Wq.js";
4
4
  import { n as splatWeights, t as buildHeightmap } from "./heightmap-CroQPEER.js";
5
- import { n as enablePhysics3D, t as Physics3D } from "./physics-3d-D_kUdOjr.js";
5
+ import { n as enablePhysics3D, t as Physics3D } from "./physics-3d-CDlvC9Z_.js";
6
6
  //#region src/3d/environment-runtime.ts
7
7
  /**
8
8
  * Live environment editing — the renderer re-applies `scene.environment`
@@ -5,8 +5,8 @@ import { t as IncantoError } from "./errors-BpWbnbb_.js";
5
5
  import { i as resolveRendering, n as attachTouchControls } from "./touch-031PxtCR.js";
6
6
  import { n as registerGameplayBehaviors } from "./gameplay-sSqrUcnz.js";
7
7
  import { t as debugSources } from "./debug-draw-CZmOYjL2.js";
8
- import { F as Node3D, M as PhysicsBody3D, d as DirectionalLight3D, l as ModelInstance3D, t as registerNodes3D, x as Camera3D } from "./register-C9-16x_t.js";
9
- import { n as enablePhysics3D } from "./physics-3d-D_kUdOjr.js";
8
+ import { I as Node3D, N as PhysicsBody3D, S as Camera3D, f as DirectionalLight3D, r as createCausticsQuad, t as registerNodes3D, u as ModelInstance3D } from "./register-Lp2qn1Wq.js";
9
+ import { n as enablePhysics3D } from "./physics-3d-CDlvC9Z_.js";
10
10
  import { ACESFilmicToneMapping, AmbientLight, Box3, BufferAttribute, BufferGeometry, Color, DepthTexture, EquirectangularReflectionMapping, FloatType, Fog, HalfFloatType, LineBasicMaterial, LineSegments, Matrix4, Mesh, PCFShadowMap, PMREMGenerator, PerspectiveCamera, PlaneGeometry, Quaternion, Raycaster, Scene, ShaderMaterial, Vector2, Vector3, WebGLRenderTarget, WebGLRenderer } from "three";
11
11
  import { VRMLoaderPlugin, VRMUtils } from "@pixiv/three-vrm";
12
12
  import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
@@ -1342,113 +1342,6 @@ function prune(obj, visited) {
1342
1342
  }
1343
1343
  }
1344
1344
  //#endregion
1345
- //#region src/3d/water/caustics.ts
1346
- /**
1347
- * Underwater caustics — the dancing refracted-light pattern the water surface
1348
- * throws onto everything below it. The engine has no post-processing pipeline,
1349
- * so the renderer does this as ONE depth-aware composite pass, and ONLY while
1350
- * the camera is genuinely underwater (so normal above-water rendering — even
1351
- * standing at the water's edge — is completely untouched):
1352
- *
1353
- * 1. render the scene to an offscreen target (color + depth)
1354
- * 2. draw this fullscreen material, which reconstructs each pixel's WORLD
1355
- * position from the depth buffer and adds an animated caustic highlight
1356
- * wherever that world point sits below the water surface
1357
- *
1358
- * Because the pattern is keyed to reconstructed world XZ, it STICKS to the
1359
- * floor/walls/props (it isn't a flat screen overlay) and fades with depth +
1360
- * view distance so it melts into the underwater fog.
1361
- */
1362
- /** Fullscreen triangle/quad — the vertex stage ignores the camera entirely. */
1363
- const CAUSTICS_VERT = `
1364
- varying vec2 vUv;
1365
- void main() {
1366
- vUv = uv;
1367
- gl_Position = vec4(position.xy, 0.0, 1.0);
1368
- }
1369
- `;
1370
- const CAUSTICS_FRAG = `
1371
- precision highp float;
1372
- varying vec2 vUv;
1373
- uniform sampler2D tColor;
1374
- uniform sampler2D tDepth;
1375
- uniform mat4 uInvViewProj;
1376
- uniform vec3 uCameraPos;
1377
- uniform float uWaterLevel;
1378
- uniform float uTime;
1379
- uniform vec3 uCausticColor;
1380
- uniform float uCausticIntensity;
1381
- uniform float uCausticScale;
1382
- uniform float uMaxDist;
1383
-
1384
- // The classic animated caustic (layered moving cells). Returns 0..1.
1385
- float caustic(vec2 uv, float t) {
1386
- vec2 p = mod(uv * 6.28318, 6.28318) - 250.0;
1387
- vec2 i = p;
1388
- float c = 1.0;
1389
- float inten = 0.005;
1390
- for (int n = 0; n < 5; n++) {
1391
- float ti = t * (1.0 - (3.5 / float(n + 1)));
1392
- i = p + vec2(cos(ti - i.x) + sin(ti + i.y), sin(ti - i.y) + cos(ti + i.x));
1393
- c += 1.0 / length(vec2(p.x / (sin(i.x + ti) / inten), p.y / (cos(i.y + ti) / inten)));
1394
- }
1395
- c /= 5.0;
1396
- c = 1.17 - pow(c, 1.4);
1397
- return clamp(pow(abs(c), 8.0), 0.0, 1.0);
1398
- }
1399
-
1400
- void main() {
1401
- vec4 color = texture2D(tColor, vUv);
1402
- float depth = texture2D(tDepth, vUv).x;
1403
- // depth == 1 is the far plane (sky/background) — nothing to light there
1404
- if (depth < 1.0) {
1405
- vec4 ndc = vec4(vUv * 2.0 - 1.0, depth * 2.0 - 1.0, 1.0);
1406
- vec4 world = uInvViewProj * ndc;
1407
- world.xyz /= world.w;
1408
- float below = uWaterLevel - world.y;
1409
- if (below > 0.0) {
1410
- float dist = distance(world.xyz, uCameraPos);
1411
- // caustics — fade with distance (melt into the fog) + a touch with depth
1412
- float distFade = 1.0 - clamp(dist / uMaxDist, 0.0, 1.0);
1413
- float depthFade = 1.0 - clamp(below / (uMaxDist * 0.5), 0.0, 0.6);
1414
- // two octaves at offset speeds = the shimmering interference of real caustics
1415
- float c =
1416
- caustic(world.xz * uCausticScale, uTime) * 0.65 +
1417
- caustic(world.xz * uCausticScale * 1.7 + 30.0, uTime * 0.8) * 0.35;
1418
- color.rgb += uCausticColor * (c * uCausticIntensity * distFade * distFade * depthFade);
1419
- }
1420
- }
1421
- gl_FragColor = color;
1422
- }
1423
- `;
1424
- /** Build the fullscreen composite mesh (a 2×2 clip-space quad). */
1425
- function createCausticsQuad() {
1426
- const material = new ShaderMaterial({
1427
- vertexShader: CAUSTICS_VERT,
1428
- fragmentShader: CAUSTICS_FRAG,
1429
- depthTest: false,
1430
- depthWrite: false,
1431
- uniforms: {
1432
- tColor: { value: null },
1433
- tDepth: { value: null },
1434
- uInvViewProj: { value: new Matrix4() },
1435
- uCameraPos: { value: new Vector3() },
1436
- uWaterLevel: { value: 0 },
1437
- uTime: { value: 0 },
1438
- uCausticColor: { value: new Color("#cdeeff") },
1439
- uCausticIntensity: { value: .55 },
1440
- uCausticScale: { value: .32 },
1441
- uMaxDist: { value: 22 }
1442
- }
1443
- });
1444
- const mesh = new Mesh(new PlaneGeometry(2, 2), material);
1445
- mesh.frustumCulled = false;
1446
- return {
1447
- mesh,
1448
- uniforms: material.uniforms
1449
- };
1450
- }
1451
- //#endregion
1452
1345
  //#region src/3d/renderer.ts
1453
1346
  /**
1454
1347
  * WebGL presentation layer: subscribes to `engine.updated`, mirrors the active
package/dist/index.js CHANGED
@@ -295,6 +295,6 @@ function newUid() {
295
295
  //#endregion
296
296
  //#region src/index.ts
297
297
  /** Engine version. Kept in sync with package.json by the release pipeline. */
298
- const VERSION = "0.14.0";
298
+ const VERSION = "0.16.0";
299
299
  //#endregion
300
300
  export { AudioBuses, AudioPlayer, Behavior, CONST_REF_KEY, Engine, HudLayer, IncantoError, InputMap, LogManager, MusicManager, Node, ORDER_GROUP_BASE, PARTICLE_PRESETS, PARTICLE_PRESET_NAMES, ParticleSim, ROLLOFF_MODELS, Rng, SCENE_FORMAT, SFX_PRESETS, SFX_PRESET_NAMES, Scene, SceneTree, SfxEngine, Signal, Timer, TouchControls, UiBanner, UiBar, UiButton, UiDialogue, UiText, VERSION, WebAudioMusicBackend, applyParticlePreset, assetUrls, attachTouchControls, auditScene, clearBehaviors, clearRegistry, computeViewport, createNode, createNoise2D, createSaveStore, crossfadeGains, duplicateNode, effectiveOrder, fadeGain, findPath, getBehavior, getNodeSchema, getNodeSignals, getNodeType, gridFromRows, isAudioContextAvailable, isConstRef, joystickVector, jsonClone, jsonEquals, jsonKind, loadScene, mergeStaticSignals, newUid, parseNodePath, preloadUrls, registerBehavior, registerCoreNodes, registerNode, registeredBehaviors, registeredTypes, replay, resolveConstants, resolveRendering, resolveViewport, serializeNode, spatialGain, spatialPan, startRecording, synthSfx };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
2
  import { t as IncantoError } from "./errors-BpWbnbb_.js";
3
3
  import { n as registerDebugSource } from "./debug-draw-CZmOYjL2.js";
4
- import { A as Area3D, F as Node3D, I as validateCollider3D, M as PhysicsBody3D, N as RigidBody3D, T as Terrain3D, j as CharacterBody3D, k as Joint3D } from "./register-C9-16x_t.js";
4
+ import { A as Joint3D, E as Terrain3D, I as Node3D, L as validateCollider3D, M as CharacterBody3D, N as PhysicsBody3D, P as RigidBody3D, j as Area3D } from "./register-Lp2qn1Wq.js";
5
5
  import { Euler, Quaternion } from "three";
6
6
  //#region src/3d/physics/physics-3d.ts
7
7
  var physics_3d_exports = /* @__PURE__ */ __exportAll({
package/dist/react.js CHANGED
@@ -156,7 +156,7 @@ function IncantoCanvas(props) {
156
156
  pointer: latest.pointer,
157
157
  ...keyboard !== void 0 ? { keyboard } : {}
158
158
  };
159
- const next = await (_gameFactory ?? (mode === "3d" ? async (o) => (await import("./create-game-OSntcIiM.js").then((n) => n.n)).createGame3D(o) : async (o) => (await import("./create-game-Ct86zczq.js").then((n) => n.n)).createGame2D(o)))(opts);
159
+ const next = await (_gameFactory ?? (mode === "3d" ? async (o) => (await import("./create-game-B5GWzy1E.js").then((n) => n.n)).createGame3D(o) : async (o) => (await import("./create-game-Ct86zczq.js").then((n) => n.n)).createGame2D(o)))(opts);
160
160
  if (disposed) {
161
161
  next.dispose();
162
162
  return;