incanto 0.23.0 → 0.25.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.
- package/dist/2d.js +1 -1
- package/dist/3d.d.ts +23 -0
- package/dist/3d.js +4 -4
- package/dist/{create-game-OyjhYUL3.js → create-game-BzaDwZX8.js} +81 -4
- package/dist/{create-game-DrcEgRup.js → create-game-sVIgbrmg.js} +1 -1
- package/dist/{gameplay-BJ5gXIks.js → gameplay-DMaCGBBn.js} +52 -16
- package/dist/gameplay.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{physics-3d-CpIB9C-F.js → physics-3d-Cwi7-zug.js} +2 -2
- package/dist/react.js +1 -1
- package/dist/{register-CpJORtm4.js → register-BnWbwRsc.js} +1 -1
- package/dist/test.js +4 -4
- package/editor/assets/{agent8-C_pbgaQC.js → agent8-DzrvlA6H.js} +1 -1
- package/editor/assets/{index-D-bWhSDj.js → index-Did0QjRa.js} +66 -30
- package/editor/index.html +1 -1
- package/package.json +1 -1
- package/skills/incanto-building-3d-games.md +3 -1
- package/skills/incanto-environment.md +36 -4
- package/templates-app/beacon-isle-3d/package.json +1 -1
- package/templates-app/tps-3d/package.json +1 -1
- package/templates-app/village-quest-3d/package.json +1 -1
package/editor/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Incanto Scene Editor</title>
|
|
7
7
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect width='16' height='16' rx='3' fill='%236ee7dc'/><text x='8' y='12' text-anchor='middle' font-size='11' font-family='monospace' fill='%230e1018'>i</text></svg>" />
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-Did0QjRa.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="./assets/GameServer-C56iOUgF.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="./assets/index-D8QvwvOm.css">
|
|
11
11
|
</head>
|
package/package.json
CHANGED
|
@@ -50,7 +50,9 @@ One call does register → load → physics → input → renderer → start. Ph
|
|
|
50
50
|
`'auto'`: Rapier is enabled iff the tree has physics bodies (force with
|
|
51
51
|
`physics: true|false`). Keyboard attaches to `window` (`keyboard: false`
|
|
52
52
|
disables); `pointer: { lockOnClick: false }` for look without lock. `seed` /
|
|
53
|
-
`fixedHz` / `pixelRatio`
|
|
53
|
+
`fixedHz` / `pixelRatio` / `adaptiveResolution` pass through (adaptive
|
|
54
|
+
resolution is ON by default: slow frames render fewer pixels and recover
|
|
55
|
+
automatically — pass `false` for screenshots and pixel-diff tests). The manual `Engine` + `loadScene` +
|
|
54
56
|
`Renderer3D` boot still exists for full control.
|
|
55
57
|
|
|
56
58
|
Imperative per-frame logic can hang off `game.engine.updated.connect((dt) => { ... })`; for
|
|
@@ -789,6 +789,21 @@ Swimming down is a different optical world, and the engine renders it as one:
|
|
|
789
789
|
"caustics": { "intensity": 0.6 } } } }
|
|
790
790
|
```
|
|
791
791
|
|
|
792
|
+
### Where water meets ground
|
|
793
|
+
|
|
794
|
+
The waterline is the thing that gives game water away. Incanto fades it in
|
|
795
|
+
SCREEN SPACE, not in metres: a beach's water column climbs from nothing to
|
|
796
|
+
knee-deep in centimetres of ground on a steep shore and in metres on a flat
|
|
797
|
+
one, so any fixed depth ramp is invisible on the first and swallows the second.
|
|
798
|
+
The shader divides the column by its own screen-space gradient, which turns the
|
|
799
|
+
fade into a constant band of pixels — no slope and no camera angle can cut it
|
|
800
|
+
back into a line. The band is then broken with world noise, breathed in and out
|
|
801
|
+
with the swash (`shoreWaves`), and its last stretch froths.
|
|
802
|
+
|
|
803
|
+
That means a shoreline needs nothing wired: no foam prop, no decal, no second
|
|
804
|
+
mesh. If you want MORE of it, `shoreWaves` drives the breathing and the
|
|
805
|
+
breakers, and `Terrain3D.wetline` darkens the sand the water just left.
|
|
806
|
+
|
|
792
807
|
### What water COSTS, and every dial that lowers it
|
|
793
808
|
|
|
794
809
|
Fancy water is not one draw — it is extra SCENE RENDERS, and each one
|
|
@@ -802,6 +817,11 @@ with grass, trees and a mirror):
|
|
|
802
817
|
| cube reflection | `reflection: true` | 256² × 6 faces | 6, every `reflectionInterval` ms (≥2 s while `mirror` is on — it is only the off-screen fallback then) |
|
|
803
818
|
| the surface itself | always | — | a ~1.5 quads/m grid, capped 160² |
|
|
804
819
|
|
|
820
|
+
The fragment shader also LODs itself: every ripple octave, the caustic loops
|
|
821
|
+
and the whitecap noise are SKIPPED once distance has faded their contribution,
|
|
822
|
+
rather than being computed and multiplied by zero. A pixel of horizon water
|
|
823
|
+
used to pay for four noise octaves to throw three away.
|
|
824
|
+
|
|
805
825
|
Grass, flowers, particles and trails are dropped from the side passes: they are
|
|
806
826
|
most of a meadow's triangles and none of what anyone reads in a reflection or a
|
|
807
827
|
depth mask.
|
|
@@ -820,10 +840,22 @@ for frames per water body:
|
|
|
820
840
|
| `foam: false` | drops the shoreline foam work |
|
|
821
841
|
| `interaction: false` | stops the per-frame body scan |
|
|
822
842
|
|
|
823
|
-
Two more, outside water
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
843
|
+
Two more, outside water. **`environment.bloom`** adds a full-resolution HDR
|
|
844
|
+
pass of its own. And PIXELS: a retina display renders **4× the pixels** of a
|
|
845
|
+
1× one, which is why a scene that profiles at 690k triangles and 270 draw calls
|
|
846
|
+
can still miss frames — it is fill-bound, not geometry-bound.
|
|
847
|
+
|
|
848
|
+
The engine handles that itself: **adaptive resolution is ON by default**. It
|
|
849
|
+
watches the median frame time over a window and, when frames run slow, renders
|
|
850
|
+
the same world at fewer pixels (down to 60% of the requested ratio, in 15%
|
|
851
|
+
steps), handing them straight back when the frames recover. One hitch never
|
|
852
|
+
moves it; a backgrounded tab never counts. Turn it off for screenshots, video
|
|
853
|
+
capture or pixel-diff tests — and pin the ratio yourself if you would rather
|
|
854
|
+
choose:
|
|
855
|
+
|
|
856
|
+
```ts
|
|
857
|
+
createGame3D({ canvas, scene, adaptiveResolution: false, pixelRatio: 1.5 });
|
|
858
|
+
```
|
|
827
859
|
|
|
828
860
|
If a scene feels heavy, measure before guessing — the browser console has the
|
|
829
861
|
whole story:
|