pixi-marrow 0.1.0-next.0 → 0.2.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/AGENTS.md +161 -0
- package/CHANGELOG.md +385 -0
- package/README.md +178 -27
- package/bin/pixi-marrow.mjs +2 -2
- package/dist/api/asset-fetch.js +164 -0
- package/dist/api/asset-holds.js +64 -0
- package/dist/api/asset-load.js +219 -0
- package/dist/api/asset-options.d.ts +81 -0
- package/dist/api/asset.d.ts +76 -77
- package/dist/api/asset.js +119 -134
- package/dist/api/assets.d.ts +20 -3
- package/dist/api/assets.js +129 -67
- package/dist/api/baking.js +20 -0
- package/dist/api/bone.d.ts +25 -4
- package/dist/api/bone.js +49 -4
- package/dist/api/checks.js +84 -25
- package/dist/api/events.d.ts +13 -1
- package/dist/api/idle-cache.js +39 -0
- package/dist/api/idle-gate.js +56 -0
- package/dist/api/idle-image.js +313 -0
- package/dist/api/idle-place.js +163 -0
- package/dist/api/links.d.ts +2 -0
- package/dist/api/links.js +2 -2
- package/dist/api/no-effect.js +75 -0
- package/dist/api/options.d.ts +131 -5
- package/dist/api/outline-scan.js +196 -30
- package/dist/api/pacing.d.ts +17 -0
- package/dist/api/pacing.js +177 -0
- package/dist/api/perf-read.js +36 -3
- package/dist/api/play-fields.js +3 -23
- package/dist/api/presets.d.ts +85 -0
- package/dist/api/presets.js +113 -0
- package/dist/api/report-base.d.ts +13 -1
- package/dist/api/report-base.js +16 -1
- package/dist/api/report-cuts.js +7 -7
- package/dist/api/report-instancing.js +85 -0
- package/dist/api/report-motion.js +75 -0
- package/dist/api/report-perf.js +48 -0
- package/dist/api/report.js +131 -42
- package/dist/api/slot.d.ts +62 -0
- package/dist/api/slot.js +127 -0
- package/dist/api/spine-links.d.ts +86 -9
- package/dist/api/spine-links.js +105 -12
- package/dist/api/spine-perf.d.ts +20 -19
- package/dist/api/spine-perf.js +18 -1
- package/dist/api/spine-physics.d.ts +135 -0
- package/dist/api/spine-physics.js +208 -0
- package/dist/api/spine.d.ts +73 -91
- package/dist/api/spine.js +168 -156
- package/dist/api/textures.js +7 -118
- package/dist/api/track-book.js +22 -6
- package/dist/api/track.d.ts +18 -2
- package/dist/api/track.js +13 -9
- package/dist/api/values.js +67 -0
- package/dist/api/view-of.js +18 -0
- package/dist/bake/bake.d.ts +63 -0
- package/dist/bake/bake.js +74 -0
- package/dist/bake/clip.d.ts +78 -0
- package/dist/bake/clip.js +41 -0
- package/dist/bake/codec.d.ts +18 -0
- package/dist/bake/codec.js +158 -0
- package/dist/bake/eligible.js +54 -0
- package/dist/bake/frame.js +170 -0
- package/dist/bake/later.js +35 -0
- package/dist/bake/pack.js +188 -0
- package/dist/bake/playback.js +219 -0
- package/dist/bake/record.d.ts +12 -0
- package/dist/bake/record.js +171 -0
- package/dist/bake/store.js +360 -0
- package/dist/bake.d.ts +9 -0
- package/dist/bake.js +4 -0
- package/dist/base/errors.d.ts +20 -4
- package/dist/base/errors.js +25 -2
- package/dist/base/names.js +5 -3
- package/dist/core.d.ts +2 -2
- package/dist/debug/drawn.js +29 -0
- package/dist/debug/overlay.d.ts +81 -0
- package/dist/debug/overlay.js +310 -0
- package/dist/debug/shapes.d.ts +44 -0
- package/dist/debug/shapes.js +138 -0
- package/dist/debug.d.ts +12 -0
- package/dist/debug.js +3 -0
- package/dist/diagnose/devtools.d.ts +67 -0
- package/dist/diagnose/devtools.js +91 -0
- package/dist/diagnose/hits.d.ts +8 -0
- package/dist/diagnose/hits.js +80 -0
- package/dist/diagnose/inspect.d.ts +19 -0
- package/dist/diagnose/inspect.js +178 -0
- package/dist/diagnose/order.js +69 -0
- package/dist/diagnose/rules-data.d.ts +12 -0
- package/dist/diagnose/rules-data.js +393 -0
- package/dist/diagnose/skeleton-rules.js +137 -0
- package/dist/diagnose/static.d.ts +10 -0
- package/dist/diagnose/static.js +151 -0
- package/dist/diagnose/tree.d.ts +42 -0
- package/dist/diagnose/tree.js +143 -0
- package/dist/diagnose/types.d.ts +290 -0
- package/dist/diagnose/watch.d.ts +47 -0
- package/dist/diagnose/watch.js +221 -0
- package/dist/diagnose.d.ts +14 -0
- package/dist/diagnose.js +8 -0
- package/dist/formats/atlas.d.ts +1 -1
- package/dist/formats/atlas.js +2 -1
- package/dist/formats/binary42/index.js +3 -2
- package/dist/formats/binary42/skeleton.js +5 -3
- package/dist/formats/binary43/animations.js +2 -2
- package/dist/formats/binary43/attachments.js +7 -7
- package/dist/formats/binary43/constraints.js +3 -3
- package/dist/formats/binary43/index.js +3 -2
- package/dist/formats/binary43/reader.js +17 -1
- package/dist/formats/binary43/skeleton.js +7 -8
- package/dist/formats/binary43/skins.js +6 -6
- package/dist/formats/binary43/timelines-attachment.js +5 -5
- package/dist/formats/binary43/timelines-constraint.js +10 -10
- package/dist/formats/binary43/timelines-curve.js +3 -3
- package/dist/formats/binary43/timelines-order.js +6 -6
- package/dist/formats/binary43/timelines-slot-bone.js +5 -5
- package/dist/formats/import.d.ts +2 -2
- package/dist/formats/import.js +7 -4
- package/dist/formats/json42/attachments.js +2 -1
- package/dist/formats/json42/index.js +3 -2
- package/dist/formats/json42/skeleton.js +4 -4
- package/dist/formats/json42/values.js +1 -8
- package/dist/formats/json43/index.js +5 -3
- package/dist/formats/json43/skeleton.js +3 -0
- package/dist/formats/shared/binary-input.js +3 -0
- package/dist/formats/shared/checks.js +23 -0
- package/dist/formats/shared/hash.js +43 -0
- package/dist/formats/shared/limits.js +12 -0
- package/dist/formats/sniff.d.ts +6 -2
- package/dist/formats/sniff.js +42 -5
- package/dist/index.d.ts +15 -8
- package/dist/optimize/cli.d.ts +4 -1
- package/dist/optimize/cli.js +83 -6
- package/dist/perf/probe.js +3 -3
- package/dist/pose/engine.d.ts +147 -6
- package/dist/pose/engine.js +7 -0
- package/dist/pose/legacy/advance.js +126 -0
- package/dist/pose/legacy/apply-timeline.js +3 -2
- package/dist/pose/legacy/apply.js +8 -6
- package/dist/pose/legacy/bones.js +3 -1
- package/dist/pose/legacy/cache.js +7 -2
- package/dist/pose/legacy/constraints.js +18 -13
- package/dist/pose/legacy/curves.js +6 -2
- package/dist/pose/legacy/deform.js +26 -13
- package/dist/pose/legacy/entry.js +33 -39
- package/dist/pose/legacy/ik2.js +2 -2
- package/dist/pose/legacy/index.js +103 -4
- package/dist/pose/legacy/math.js +11 -5
- package/dist/pose/legacy/pass.js +27 -20
- package/dist/pose/legacy/player.js +11 -4
- package/dist/pose/legacy/rest.js +6 -48
- package/dist/pose/legacy/rig.js +7 -1
- package/dist/pose/legacy/skeleton.js +9 -4
- package/dist/pose/legacy/slots.js +1 -1
- package/dist/pose/legacy/world.js +9 -9
- package/dist/pose/shared/combine-skins.js +110 -0
- package/dist/pose/shared/configure.js +78 -0
- package/dist/pose/shared/deform-switch.js +60 -0
- package/dist/pose/shared/fired.js +9 -0
- package/dist/pose/shared/kept.js +64 -0
- package/dist/pose/shared/lookup.d.ts +33 -2
- package/dist/pose/shared/lookup.js +62 -12
- package/dist/pose/shared/search.js +48 -0
- package/dist/pose/shared/slot-writes.js +50 -0
- package/dist/pose/state.js +8 -2
- package/dist/pose/v43/advance.js +105 -0
- package/dist/pose/v43/apply-events.js +5 -5
- package/dist/pose/v43/apply.js +56 -60
- package/dist/pose/v43/cache.js +3 -3
- package/dist/pose/v43/configure.js +24 -41
- package/dist/pose/v43/curves.js +6 -2
- package/dist/pose/v43/ik-two.js +2 -2
- package/dist/pose/v43/index.js +113 -10
- package/dist/pose/v43/math.js +11 -5
- package/dist/pose/v43/player.js +15 -13
- package/dist/pose/v43/pose.js +3 -2
- package/dist/pose/v43/property-ids.js +17 -0
- package/dist/pose/v43/repeat.js +82 -0
- package/dist/pose/v43/rig.js +39 -19
- package/dist/pose/v43/skeleton.js +44 -2
- package/dist/pose/v43/slots.js +5 -1
- package/dist/pose/v43/solve-tight.js +3 -3
- package/dist/pose/v43/solve.js +3 -3
- package/dist/pose/v43/split.js +3 -2
- package/dist/pose/v43/timelines-deform.js +34 -21
- package/dist/pose/v43/timelines-misc.js +1 -1
- package/dist/pose/v43/timelines.js +3 -2
- package/dist/pose/v43/update.js +1 -0
- package/dist/pose/v43/world.js +5 -5
- package/dist/render/attach-work.js +1 -1
- package/dist/render/batch-body.d.ts +2 -1
- package/dist/render/batch-body.js +9 -3
- package/dist/render/batch-clip.js +30 -8
- package/dist/render/batch-element.d.ts +28 -51
- package/dist/render/batch-element.js +64 -18
- package/dist/render/batch-home.d.ts +57 -0
- package/dist/render/batch-image.js +192 -0
- package/dist/render/batch-pack.d.ts +3 -0
- package/dist/render/batch-pack.js +9 -1
- package/dist/render/batch-pipe.js +19 -14
- package/dist/render/batch-shader.js +67 -86
- package/dist/render/batch-upload.js +30 -61
- package/dist/render/batcher.js +23 -48
- package/dist/render/bounds.d.ts +29 -0
- package/dist/render/bounds.js +42 -1
- package/dist/render/clip-mask.js +3 -0
- package/dist/render/colors.js +7 -23
- package/dist/render/context-watch.js +18 -3
- package/dist/render/cover-search.d.ts +8 -1
- package/dist/render/cover-search.js +7 -3
- package/dist/render/cover.d.ts +5 -3
- package/dist/render/cover.js +4 -4
- package/dist/render/dark-batcher.js +22 -0
- package/dist/render/drafts.js +1 -1
- package/dist/render/entry-pose.js +1 -1
- package/dist/render/inspect.d.ts +1 -0
- package/dist/render/inspect.js +31 -3
- package/dist/render/instance-id.js +4 -0
- package/dist/render/instance-layout.d.ts +94 -0
- package/dist/render/instance-layout.js +383 -0
- package/dist/render/instance-paint.d.ts +82 -0
- package/dist/render/instance-paint.js +121 -0
- package/dist/render/instance-part.d.ts +66 -0
- package/dist/render/instance-part.js +228 -0
- package/dist/render/instance-pipe.d.ts +37 -0
- package/dist/render/instance-pipe.js +239 -0
- package/dist/render/instance-pool.d.ts +116 -0
- package/dist/render/instance-pool.js +259 -0
- package/dist/render/instance-shader.js +306 -0
- package/dist/render/layouts.js +37 -6
- package/dist/render/mesh-code.js +1 -1
- package/dist/render/mesh-paint.d.ts +105 -12
- package/dist/render/mesh-paint.js +276 -30
- package/dist/render/mesh-pipe.js +12 -8
- package/dist/render/mesh-uniforms.js +144 -0
- package/dist/render/mode.js +5 -1
- package/dist/render/paints.d.ts +7 -1
- package/dist/render/paints.js +15 -7
- package/dist/render/pose-pass.d.ts +12 -1
- package/dist/render/pose-pass.js +42 -8
- package/dist/render/range-mesh.d.ts +8 -2
- package/dist/render/range-mesh.js +90 -40
- package/dist/render/ranges.d.ts +4 -2
- package/dist/render/ranges.js +12 -11
- package/dist/render/sent.js +34 -0
- package/dist/render/shader.js +44 -15
- package/dist/render/skeleton-view.d.ts +13 -12
- package/dist/render/skeleton-view.js +34 -35
- package/dist/render/skin-layout.d.ts +21 -0
- package/dist/render/skin-layout.js +172 -0
- package/dist/render/skin-paint.js +133 -0
- package/dist/render/skin-pose.js +166 -0
- package/dist/render/skin-shader.js +243 -0
- package/dist/render/skin-store.d.ts +20 -0
- package/dist/render/skin-store.js +75 -0
- package/dist/render/stats.d.ts +57 -3
- package/dist/render/stats.js +13 -1
- package/dist/render/template.js +3 -3
- package/dist/render/vertex-colors.js +23 -0
- package/package.json +46 -9
- package/perf-rules.json +390 -0
- package/skills/pixi-marrow/SKILL.md +39 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# pixi-marrow for coding agents
|
|
2
|
+
|
|
3
|
+
This file ships in the npm package `pixi-marrow`. It tells a coding agent how to use the package in a game, and how to find what costs time in a scene. The guide for work on the repo itself is the `AGENTS.md` in the GitHub repo.
|
|
4
|
+
|
|
5
|
+
## What the package is
|
|
6
|
+
|
|
7
|
+
pixi-marrow is a Spine runtime for PixiJS v8. It plays skeletons that the Spine editor exported as 4.1, 4.2 or 4.3, on WebGL2 and WebGPU. `MarrowSpine` is a Pixi `Container`. The package needs `pixi.js` 8.23 or later and has no other dependency.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install pixi-marrow pixi.js
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Entry points
|
|
14
|
+
|
|
15
|
+
| Import | Use it for |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `pixi-marrow` | `MarrowSpine`, `MarrowAsset`, `Track`, `MarrowError`, `registerMarrowAssets` |
|
|
18
|
+
| `pixi-marrow/core` | Readers and pose engines without Pixi. Runs in Node |
|
|
19
|
+
| `pixi-marrow/optimize` | `generateNames`, `buildAtlasOutlines` and the command line tool |
|
|
20
|
+
| `pixi-marrow/bake` | Animations baked at build time or in the game |
|
|
21
|
+
| `pixi-marrow/debug` | `MarrowDebug`, overlays of bones, shapes and overdraw |
|
|
22
|
+
| `pixi-marrow/perf` | `createProbe`, which times the updates of one skeleton |
|
|
23
|
+
| `pixi-marrow/diagnose` | `diagnose`, `watch`, `inspect`, `serializeTree`, `installDevtools` |
|
|
24
|
+
| `pixi-marrow/perf-rules.json` | The performance rules as data |
|
|
25
|
+
|
|
26
|
+
## Load
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { MarrowSpine } from 'pixi-marrow';
|
|
30
|
+
|
|
31
|
+
const hero = await MarrowSpine.load({ skeleton: 'hero.skel', atlas: 'hero.atlas' });
|
|
32
|
+
app.stage.addChild(hero);
|
|
33
|
+
hero.position.set(400, 500);
|
|
34
|
+
// hero.destroy() also unloads the files when no other copy uses them
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Loads of the same files share one asset. For many copies, load the asset once with `MarrowAsset.load` and call `new MarrowSpine(asset)` for each copy. With Pixi `Assets`, call `registerMarrowAssets()` once, and then `MarrowSpine.from({ skeleton, atlas })` with the aliases.
|
|
38
|
+
|
|
39
|
+
## Play
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
hero.play('idle', { loop: true });
|
|
43
|
+
const shot = hero.play('shoot', { track: 1, mix: 0.1, speed: 1.5 });
|
|
44
|
+
const reason = await shot.finished; // 'complete', 'interrupted', 'stopped' or 'destroyed'
|
|
45
|
+
hero.stop({ track: 1, mix: 0.2 });
|
|
46
|
+
hero.setMix('idle', 'run', 0.2);
|
|
47
|
+
hero.timeScale = 0.5;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Queue
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
hero.play('jump');
|
|
54
|
+
hero.queue('land', { mix: 0.1 });
|
|
55
|
+
hero.queue('run', { loop: true, mix: 0.2, delay: 0.5 });
|
|
56
|
+
const last = hero.queue('idle', { loop: true });
|
|
57
|
+
console.log(last.animation);
|
|
58
|
+
await hero.play('win').finished;
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Events
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
hero.on('event', (event, track) => console.log(event.name, track.animation));
|
|
65
|
+
hero.on('complete', (track) => console.log(track.animation, 'played to its end'));
|
|
66
|
+
hero.once('start', (track) => console.log(track.animation, 'started'));
|
|
67
|
+
hero.on('end', (track) => console.log(track.animation, 'will not be applied again'));
|
|
68
|
+
hero.off('complete');
|
|
69
|
+
// the names are start, interrupt, end, dispose, complete and event
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Typed names
|
|
73
|
+
|
|
74
|
+
The command line tool writes a type with every name of a skeleton. A wrong animation, skin, bone or slot name then does not compile.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx pixi-marrow typegen hero.skel --out hero.names.ts --name HeroNames
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import type { HeroNames } from './hero.names';
|
|
82
|
+
|
|
83
|
+
const hero = await MarrowSpine.load<HeroNames>({ skeleton: 'hero.skel', atlas: 'hero.atlas' });
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Errors
|
|
87
|
+
|
|
88
|
+
The package throws one error type, `MarrowError`. Read `error.code`, `error.fix`, `error.closest` and `error.docs`. Do not parse the message. An unknown option key throws `invalid-option` with the closest name.
|
|
89
|
+
|
|
90
|
+
## Options that cost something are opt-in
|
|
91
|
+
|
|
92
|
+
The default is exact. A skeleton looks and moves as in the official runtime, and the runtime does only work that changes no pixel. Do not add a performance option before a measurement or a rule asks for it.
|
|
93
|
+
|
|
94
|
+
- `perf: 'balanced'` or `perf: 'fast'` changes when a skeleton updates, and nothing else.
|
|
95
|
+
- `tightMesh: 'on'`, `bake`, `idleCache`, `lod`, `skinning: 'gpu'` and `instancing` each cost memory, vertices or exactness. Set each one by name.
|
|
96
|
+
- Outlines make the exact cuts of overdraw possible. Build them with `npx pixi-marrow outlines hero.atlas` and pass the file as `outlines`.
|
|
97
|
+
- `await hero.perf.report()` lists every decision of the runtime for one skeleton, with the reason.
|
|
98
|
+
|
|
99
|
+
## Diagnose a scene
|
|
100
|
+
|
|
101
|
+
Add one line to the development build. The package registers nothing until that call.
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import { installDevtools } from 'pixi-marrow/diagnose';
|
|
105
|
+
|
|
106
|
+
installDevtools({ root: app.stage, renderer: app.renderer });
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Then run code in the page, through the console or a browser tool.
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
__PIXI_MARROW__.diagnose(app.stage).hits; // the causes that one look finds
|
|
113
|
+
const watching = __PIXI_MARROW__.watch(app.stage); // note the counters
|
|
114
|
+
watching.report().hits; // after some frames: also the causes that show over time
|
|
115
|
+
__PIXI_MARROW__.inspect(); // each skeleton as plain data
|
|
116
|
+
JSON.stringify(__PIXI_MARROW__.tree()); // save it, then run: npx pixi-marrow diagnose tree.json
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Each hit has `id`, `node`, `cause`, `cost`, `measured`, `message`, `fix` and `docs`. `node` is the path of the skeleton in the tree, and `cause` is the path of the display object to change. Apply the `fix` to the `cause`, then call `report()` again to check that the hit is gone.
|
|
120
|
+
|
|
121
|
+
Without the hook, find skeletons by the field `isMarrowSpine` and read `hero.stats`. The functions `diagnose(root)` and `inspect(hero)` of `pixi-marrow/diagnose` do the same work as the hook.
|
|
122
|
+
|
|
123
|
+
## Performance rules
|
|
124
|
+
|
|
125
|
+
<!-- rules:table -->
|
|
126
|
+
| Id | Cause | Fix |
|
|
127
|
+
| --- | --- | --- |
|
|
128
|
+
| [MARROW001](https://pixi-marrow.schmooky.dev/performance/rules/#marrow001) | A display object above a batched skeleton moves | Set `isRenderGroup: true` on the container that moves, or set `renderMode: 'mesh'` on the skeleton. |
|
|
129
|
+
| [MARROW002](https://pixi-marrow.schmooky.dev/performance/rules/#marrow002) | The alpha or the tint above a batched skeleton changes | Fade a container that has `isRenderGroup: true`, fade slots with `hero.slot(name).alpha`, or set `renderMode: 'mesh'`. |
|
|
130
|
+
| [MARROW003](https://pixi-marrow.schmooky.dev/performance/rules/#marrow003) | An alpha or a blend mode above the skeleton stops occlusion and the idle image | Keep the alpha at 1 and the blend mode at `normal` while the skeleton is at rest. Fade for a short time only. |
|
|
131
|
+
| [MARROW004](https://pixi-marrow.schmooky.dev/performance/rules/#marrow004) | Another display object draws between two batched skeletons | Put the skeletons into one container and the other objects into a container above or below it. |
|
|
132
|
+
| [MARROW005](https://pixi-marrow.schmooky.dev/performance/rules/#marrow005) | A sorted container mixes skeletons with other display objects | Give the skeletons one range of `zIndex` values, or put them into a layer of their own. |
|
|
133
|
+
| [MARROW006](https://pixi-marrow.schmooky.dev/performance/rules/#marrow006) | A blend mode splits the draws of a skeleton | Use additive slots where the art allows it. Put skeletons with the same blend mode next to each other in the draw order. |
|
|
134
|
+
| [MARROW007](https://pixi-marrow.schmooky.dev/performance/rules/#marrow007) | More atlas pages than one draw can sample | Pack the atlas into fewer pages, or share one atlas between the skeletons of a layer. |
|
|
135
|
+
| [MARROW008](https://pixi-marrow.schmooky.dev/performance/rules/#marrow008) | The device samples fewer textures than the skeleton needs in a batch | Pack the atlas into fewer pages than the device samples in one batch. |
|
|
136
|
+
| [MARROW009](https://pixi-marrow.schmooky.dev/performance/rules/#marrow009) | Many copies of a skeleton that is too large to batch | Set `skinning: 'gpu'` and `instancing: 'auto'`, or use a skeleton with fewer vertices. |
|
|
137
|
+
| [MARROW010](https://pixi-marrow.schmooky.dev/performance/rules/#marrow010) | A clipping attachment in the batched mode | Remove the clipping attachment in the Spine editor, or keep the clipped slots few and small. |
|
|
138
|
+
| [MARROW011](https://pixi-marrow.schmooky.dev/performance/rules/#marrow011) | A clipping attachment in the mesh mode | Remove the clipping attachment in the Spine editor, or set `renderMode: 'batched'` for a small skeleton. |
|
|
139
|
+
| [MARROW012](https://pixi-marrow.schmooky.dev/performance/rules/#marrow012) | A container attached to a slot | Use `hero.follow(bone, container)` where the container can draw above or below the whole skeleton. |
|
|
140
|
+
| [MARROW013](https://pixi-marrow.schmooky.dev/performance/rules/#marrow013) | A skeleton without dark colors draws before one with dark colors | Draw a skeleton with dark colors first in the layer, or keep the two kinds in separate layers. |
|
|
141
|
+
| [MARROW014](https://pixi-marrow.schmooky.dev/performance/rules/#marrow014) | Pixi builds the instructions of the render group again and again | Keep display objects in a pool and move them off the screen. Give a layer that changes often a render group of its own. |
|
|
142
|
+
| [MARROW015](https://pixi-marrow.schmooky.dev/performance/rules/#marrow015) | A skeleton that nobody sees still updates | Set `perf: 'balanced'` or `offscreen: 'pause'`, or stop the `update()` calls for a hidden skeleton. |
|
|
143
|
+
| [MARROW016](https://pixi-marrow.schmooky.dev/performance/rules/#marrow016) | The renderer turns the cuts of overdraw off | Turn `roundPixels` and `antialias` off, or accept the overdraw. |
|
|
144
|
+
| [MARROW017](https://pixi-marrow.schmooky.dev/performance/rules/#marrow017) | A filter or a mask above the skeleton | Put the filter or the mask on the smallest container that needs it, and remove it when its effect ends. |
|
|
145
|
+
| [MARROW018](https://pixi-marrow.schmooky.dev/performance/rules/#marrow018) | A playing skeleton below a container with `cacheAsTexture` | Cache only containers whose skeletons are at rest. For one skeleton at rest, use `idleCache: 'auto'`. |
|
|
146
|
+
| [MARROW019](https://pixi-marrow.schmooky.dev/performance/rules/#marrow019) | The idle cache draws and drops its image again and again | Set `idleCache: 'off'` for a skeleton that does not rest for seconds. |
|
|
147
|
+
| [MARROW020](https://pixi-marrow.schmooky.dev/performance/rules/#marrow020) | The asset has no outlines | Run `pixi-marrow outlines <atlas>` at build time and pass the file as the `outlines` option of the load. |
|
|
148
|
+
| [MARROW021](https://pixi-marrow.schmooky.dev/performance/rules/#marrow021) | A page texture blocks the cuts of overdraw | Load the page textures at the size of the atlas, with no mipmaps, no anisotropy and no repeat. |
|
|
149
|
+
| [MARROW022](https://pixi-marrow.schmooky.dev/performance/rules/#marrow022) | Physics constraints run in every update | Set `hero.physics = 'none'` for small or far skeletons, or set `lod: 'auto'`. |
|
|
150
|
+
| [MARROW023](https://pixi-marrow.schmooky.dev/performance/rules/#marrow023) | The runtime builds the vertex layout again and again | Set the skins once. To change one attachment, use `hero.slot(name).attachment`. |
|
|
151
|
+
| [MARROW024](https://pixi-marrow.schmooky.dev/performance/rules/#marrow024) | More mesh draws on WebGPU than the shared uniform buffer of Pixi holds | Use the batched mode for small skeletons, or `skinning: 'gpu'` with `instancing: 'auto'` for large ones. |
|
|
152
|
+
| [MARROW025](https://pixi-marrow.schmooky.dev/performance/rules/#marrow025) | A Spine 4.3 track changes its animation faster than the mix | Let a mix end before the next change, or change with `mix: 0`. |
|
|
153
|
+
<!-- /rules:table -->
|
|
154
|
+
|
|
155
|
+
## Docs
|
|
156
|
+
|
|
157
|
+
- Site: https://pixi-marrow.schmooky.dev
|
|
158
|
+
- Rules: https://pixi-marrow.schmooky.dev/performance/rules/
|
|
159
|
+
- For language models, as an index: https://pixi-marrow.schmooky.dev/llms.txt
|
|
160
|
+
- For language models, in one file: https://pixi-marrow.schmooky.dev/llms-full.txt
|
|
161
|
+
- Each docs page as Markdown: the address of the page with `.md` in place of the last slash.
|