@codexo/exojs 0.6.2 → 0.6.3
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/CHANGELOG.md +516 -499
- package/README.md +156 -156
- package/dist/esm/core/capabilities.d.ts +37 -0
- package/dist/esm/core/capabilities.js +96 -0
- package/dist/esm/core/capabilities.js.map +1 -0
- package/dist/esm/core/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/rendering/webgl2/glsl/mask-compose.frag.js +1 -1
- package/dist/esm/rendering/webgl2/glsl/mask-compose.vert.js +1 -1
- package/dist/esm/rendering/webgl2/glsl/particle.frag.js +1 -1
- package/dist/esm/rendering/webgl2/glsl/primitive.frag.js +1 -1
- package/dist/esm/rendering/webgl2/glsl/primitive.vert.js +1 -1
- package/dist/esm/rendering/webgl2/glsl/sprite.frag.js +1 -1
- package/dist/esm/rendering/webgpu/WebGpuBackend.js +41 -41
- package/dist/esm/rendering/webgpu/WebGpuBackend.js.map +1 -1
- package/dist/esm/rendering/webgpu/WebGpuMaskCompositor.js +44 -44
- package/dist/esm/rendering/webgpu/WebGpuMaskCompositor.js.map +1 -1
- package/dist/esm/rendering/webgpu/WebGpuParticleRenderer.js +65 -65
- package/dist/esm/rendering/webgpu/WebGpuParticleRenderer.js.map +1 -1
- package/dist/esm/rendering/webgpu/WebGpuPrimitiveRenderer.js +25 -25
- package/dist/esm/rendering/webgpu/WebGpuPrimitiveRenderer.js.map +1 -1
- package/dist/esm/vendor/webgl-debug.js +1156 -1156
- package/dist/esm/vendor/webgl-debug.js.map +1 -1
- package/dist/exo.esm.js +1432 -1338
- package/dist/exo.esm.js.map +1 -1
- package/package.json +105 -105
package/CHANGELOG.md
CHANGED
|
@@ -1,499 +1,516 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to ExoJS are documented in this file.
|
|
4
|
-
|
|
5
|
-
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
-
|
|
7
|
-
## [0.6.
|
|
8
|
-
|
|
9
|
-
Adds the `
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
`
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
`
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
`mesh
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
`
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
`
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
`
|
|
111
|
-
`
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
`
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
`
|
|
129
|
-
`
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
-
|
|
148
|
-
|
|
149
|
-
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
- **`
|
|
293
|
-
- **`Scene
|
|
294
|
-
|
|
295
|
-
###
|
|
296
|
-
|
|
297
|
-
- **`
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
- `
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
-
|
|
361
|
-
|
|
362
|
-
###
|
|
363
|
-
|
|
364
|
-
-
|
|
365
|
-
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
-
|
|
394
|
-
- `
|
|
395
|
-
-
|
|
396
|
-
-
|
|
397
|
-
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
-
|
|
402
|
-
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
-
|
|
414
|
-
-
|
|
415
|
-
-
|
|
416
|
-
-
|
|
417
|
-
-
|
|
418
|
-
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
-
|
|
424
|
-
-
|
|
425
|
-
-
|
|
426
|
-
- `
|
|
427
|
-
|
|
428
|
-
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
-
|
|
434
|
-
- `
|
|
435
|
-
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
-
|
|
441
|
-
-
|
|
442
|
-
-
|
|
443
|
-
-
|
|
444
|
-
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
-
|
|
451
|
-
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
-
|
|
458
|
-
- `
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
-
|
|
466
|
-
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
-
|
|
473
|
-
-
|
|
474
|
-
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
-
|
|
480
|
-
-
|
|
481
|
-
-
|
|
482
|
-
-
|
|
483
|
-
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to ExoJS are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [0.6.3] - 2026-05-02
|
|
8
|
+
|
|
9
|
+
Adds the `capabilities` feature-detection API. Pure addition — no
|
|
10
|
+
existing surface changes shape.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`capabilities` and `isSupported`.** A frozen
|
|
15
|
+
`Readonly<Record<CapabilityName, boolean>>` evaluated once at
|
|
16
|
+
module load, plus a typed `isSupported(name)` lookup. Initial
|
|
17
|
+
probes: `webgl2`, `webgpu`, `audio`, `pointer`, `touch`, `gamepad`,
|
|
18
|
+
`keyboard`, `fullscreen`, `vibration`, `offscreenCanvas`. All
|
|
19
|
+
probes are synchronous; for "is the WebGPU adapter actually
|
|
20
|
+
available" the answer remains async and lives in `Application`'s
|
|
21
|
+
backend selection. `Capabilities` and `CapabilityName` types are
|
|
22
|
+
also exported.
|
|
23
|
+
|
|
24
|
+
## [0.6.2] - 2026-05-02
|
|
25
|
+
|
|
26
|
+
Adds the `Mesh` primitive — the first new public Drawable since the
|
|
27
|
+
0.6.0 cleanup. PATCH bump because the only change is additive: a new
|
|
28
|
+
class plus its two backend renderers; nothing existing changes shape.
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- **`Mesh` Drawable.** Arbitrary 2D triangle-mesh primitive sitting
|
|
33
|
+
alongside `Sprite` in the Drawable hierarchy. Construction takes a
|
|
34
|
+
`MeshOptions` object with required `vertices` (flat (x,y) pairs) and
|
|
35
|
+
optional `indices`, `uvs`, `colors` (packed RGBA8 u32 per vertex),
|
|
36
|
+
and `texture`. Mesh data is immutable post-construction, but the
|
|
37
|
+
underlying typed arrays may be mutated in place — call
|
|
38
|
+
`mesh.recomputeLocalBounds()` afterwards to keep culling correct.
|
|
39
|
+
Validation is enforced at construction (mismatched array lengths,
|
|
40
|
+
out-of-range indices, non-multiple-of-3 vertex/index counts all
|
|
41
|
+
throw).
|
|
42
|
+
- **`WebGl2MeshRenderer`.** Single-drawcall-per-mesh path on WebGL2.
|
|
43
|
+
Vertex layout is 20 bytes (pos f32x2 + uv f32x2 + color u8x4-norm).
|
|
44
|
+
Texture is bound to slot 0; meshes without an explicit texture
|
|
45
|
+
resolve to `Texture.white` so the fragment shader stays branchless.
|
|
46
|
+
- **`WebGpuMeshRenderer`.** Deferred batched-pass path on WebGPU. CPU
|
|
47
|
+
bakes (view × globalTransform) into vertex positions so the WGSL is
|
|
48
|
+
uniform-free except for a per-mesh dynamic-offset tint+flags slot.
|
|
49
|
+
Pipelines are created per (blendMode × format) and pre-warmed via
|
|
50
|
+
`prewarmPipelines` during backend init. Texture bind groups are
|
|
51
|
+
cached per Texture/RenderTexture instance.
|
|
52
|
+
- **Three live examples** under `examples/public/examples/rendering/`:
|
|
53
|
+
`mesh-triangle.js` (untextured, vertex-colored), `mesh-textured-quad.js`
|
|
54
|
+
(textured quad equivalent to a Sprite, hand-built from a Mesh), and
|
|
55
|
+
`mesh-deformed-grid.js` (16×16 grid whose vertex positions wave
|
|
56
|
+
each frame — demonstrates the deformation use case Sprite can't
|
|
57
|
+
handle).
|
|
58
|
+
|
|
59
|
+
## [0.6.1] - 2026-05-02
|
|
60
|
+
|
|
61
|
+
Playground-only release. Library code is unchanged from 0.6.0; the
|
|
62
|
+
npm tarball ships byte-for-byte the same `dist/` output. The version
|
|
63
|
+
bump exists so the published changelog and the playground's release
|
|
64
|
+
catalog stay in sync.
|
|
65
|
+
|
|
66
|
+
### Changed
|
|
67
|
+
|
|
68
|
+
- **Playground version selector now reads GitHub Releases at runtime.**
|
|
69
|
+
The dropdown was previously fed by a committed `versions.json` plus
|
|
70
|
+
per-version snapshot directories under
|
|
71
|
+
`examples/public/examples/versions/<id>/` and
|
|
72
|
+
`examples/public/vendor/exojs/<id>/`. Both are gone. The dropdown
|
|
73
|
+
now fetches from the GitHub Releases API
|
|
74
|
+
(`api.github.com/repos/Exoridus/ExoJS/releases`); the special
|
|
75
|
+
"current" entry continues to load locally-vendored sources for the
|
|
76
|
+
build-time HEAD. Example sources for any released version load
|
|
77
|
+
from `raw.githubusercontent.com/Exoridus/ExoJS/v<id>/...` and the
|
|
78
|
+
library bundle loads from `cdn.jsdelivr.net/npm/@codexo/exojs@<id>`.
|
|
79
|
+
Versions appear in the dropdown automatically once a tag is
|
|
80
|
+
published — no bookkeeping commit is needed any more.
|
|
81
|
+
|
|
82
|
+
### Removed
|
|
83
|
+
|
|
84
|
+
- **Versioned-snapshot scaffolding in the playground.** The
|
|
85
|
+
`examples/public/examples/versions/` snapshot tree, the
|
|
86
|
+
per-version `examples/public/vendor/exojs/<id>/` mirrors, and
|
|
87
|
+
`examples/public/examples/versions.json` are all gone, along with
|
|
88
|
+
the `phase2-bundle.smoke.test.mjs` smoke test that policed their
|
|
89
|
+
byte-identical layout. The `versions.json` shape test in
|
|
90
|
+
`phase1-bundle.smoke.test.mjs` is also gone. `sync-exo-vendor.ts`
|
|
91
|
+
no longer mirrors the flat vendor into a versioned subdirectory.
|
|
92
|
+
|
|
93
|
+
## [0.6.0] - 2026-05-02
|
|
94
|
+
|
|
95
|
+
A large pre-1.0 cleanup release. Two intentional API breaks (Backend
|
|
96
|
+
rename, Scene class-only), a full GPU-instancing pass across sprite
|
|
97
|
+
and particle renderers on both backends, and a slimmer npm package
|
|
98
|
+
shape. All on a single 0.x minor since the project is still pre-1.0
|
|
99
|
+
and breaks freely between minors.
|
|
100
|
+
|
|
101
|
+
### Breaking
|
|
102
|
+
|
|
103
|
+
- **`Runtime` types renamed to `Backend`; render-manager classes
|
|
104
|
+
collapse into the same name.** `SceneRenderRuntime` →
|
|
105
|
+
`RenderBackend`. The split `WebGl2RendererRuntime` /
|
|
106
|
+
`WebGpuRendererRuntime` interfaces are gone — the concrete classes
|
|
107
|
+
are the public type. `WebGl2RenderManager` → `WebGl2Backend`,
|
|
108
|
+
`WebGpuRenderManager` → `WebGpuBackend`. `Application.renderManager`
|
|
109
|
+
→ `Application.backend`. Internal field/parameter names follow
|
|
110
|
+
(`runtime` → `backend`, `_runtime` → `_backend`, `getRuntime()` →
|
|
111
|
+
`getBackend()`). `WebGl2ShaderRuntime` → `WebGl2ShaderProgram` (the
|
|
112
|
+
type stores a `WebGLProgram` plus its bound state — the new name
|
|
113
|
+
reflects that). `WebGl2RenderBufferRuntime` and
|
|
114
|
+
`WebGl2VertexArrayObjectRuntime` keep their names — they describe
|
|
115
|
+
per-resource lifecycle, not the render backend.
|
|
116
|
+
- **`Scene` is class-only; the plain-object definition constructor is
|
|
117
|
+
gone.** `new Scene({ update() { ... } })` no longer works. Subclass
|
|
118
|
+
to define a scene — `class GameScene extends Scene { override
|
|
119
|
+
update(...) { ... } }` for named scenes, `new class extends Scene
|
|
120
|
+
{ ... }` for one-offs. The `SceneData` interface and
|
|
121
|
+
`SceneInstance<T>` type alias are removed (they only existed to
|
|
122
|
+
type the spread-into-`this` constructor). Internal Scene fields
|
|
123
|
+
move from ECMAScript `#`-private to TS `protected _app/_root/
|
|
124
|
+
_stackMode/_inputMode` — subclasses can now reach internal state
|
|
125
|
+
directly when they need to.
|
|
126
|
+
- **npm package shape simplified.** Dropped: `dist/exo.global.js` /
|
|
127
|
+
`dist/exo.global.min.js` (legacy IIFE for `<script>` use) and
|
|
128
|
+
`dist/exo.esm.min.js` (consumers minify on their side). What ships
|
|
129
|
+
now: `dist/esm/` (per-module ESM tree, the canonical entry) and
|
|
130
|
+
`dist/exo.esm.js` (single-file ESM bundle for direct module
|
|
131
|
+
loading). `package.json#main`, `module`, `browser`, `exports` are
|
|
132
|
+
unchanged in semantics — only the auxiliary artifacts go away.
|
|
133
|
+
|
|
134
|
+
### Performance
|
|
135
|
+
|
|
136
|
+
- **WebGL2 sprite renderer is now fully GPU-instanced.** Quad
|
|
137
|
+
corners derive from `gl_VertexID` in the vertex shader; per-instance
|
|
138
|
+
attributes carry `localBounds`, `transformAB`/`transformCD` (the 2D
|
|
139
|
+
affine), `uvBounds`, packed RGBA8 tint, and packed slot/flags (56
|
|
140
|
+
bytes per instance). The CPU per-frame cost is one bounded
|
|
141
|
+
`writeBuffer` per batch; no per-vertex stream is uploaded.
|
|
142
|
+
`drawArraysInstanced` over `TRIANGLE_STRIP` replaces the per-vertex
|
|
143
|
+
`drawElements` path.
|
|
144
|
+
- **WebGPU sprite renderer matches the same instanced layout.** Uses
|
|
145
|
+
`drawIndexed` over a static `[0,1,2,0,2,3]` index buffer with
|
|
146
|
+
`triangle-list` topology (the index buffer keeps mock-frame
|
|
147
|
+
bookkeeping deterministic — the on-screen result is the same as a
|
|
148
|
+
triangle-strip).
|
|
149
|
+
- **Particle renderers fully instanced on both backends, with system
|
|
150
|
+
data hoisted out of per-instance.** `localBounds`, `uvBounds`, and
|
|
151
|
+
`systemTransform` are now uniforms (one upload per system per
|
|
152
|
+
frame). Per-instance shrinks from 56 to 24 bytes (translation,
|
|
153
|
+
scale, rotation, packed RGBA8 color). `WebGl2ParticleRenderer` no
|
|
154
|
+
longer extends `AbstractWebGl2BatchedRenderer` — particles don't
|
|
155
|
+
share batch infrastructure with sprites anymore.
|
|
156
|
+
|
|
157
|
+
### Removed
|
|
158
|
+
|
|
159
|
+
- `docs/` directory and the README's "Next Steps" link block. The
|
|
160
|
+
prose docs were drifting out of sync with the code; the in-repo
|
|
161
|
+
examples (`examples/README.md`) remain the supported reference.
|
|
162
|
+
- `SceneRenderRuntime`, `WebGl2RendererRuntime`, `WebGpuRendererRuntime`
|
|
163
|
+
interfaces (collapsed into the renamed classes — see Breaking).
|
|
164
|
+
- `SceneData` interface, `SceneInstance<T>` type alias (no longer
|
|
165
|
+
needed without the Scene definition-spread constructor).
|
|
166
|
+
- `WebGl2RenderManager`, `WebGpuRenderManager` class names (renamed
|
|
167
|
+
to `*Backend` — see Breaking).
|
|
168
|
+
- `Sampler._premultiplyAlpha`, `Sampler._generateMipMap`,
|
|
169
|
+
`Sampler._flipY` (write-only — texture pixel-store path consumes
|
|
170
|
+
these directly from `SamplerOptions`, the GL sampler object only
|
|
171
|
+
cares about scale and wrap modes).
|
|
172
|
+
- `AudioAnalyser._audioContext` (write-only — never read after
|
|
173
|
+
setup).
|
|
174
|
+
- `WebGpuRenderManager._blendMode` (write-only — renderers consult
|
|
175
|
+
`sprite.blendMode` directly; `setBlendMode` keeps its
|
|
176
|
+
not-yet-implemented blend-mode validation).
|
|
177
|
+
- `@rollup/plugin-terser` devDependency (no minified bundle output
|
|
178
|
+
any more).
|
|
179
|
+
|
|
180
|
+
### Migration
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
// Before (0.5.x)
|
|
184
|
+
class GameScene extends Scene {
|
|
185
|
+
override draw(runtime: SceneRenderRuntime): void {
|
|
186
|
+
this.root.render(runtime);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const triangleRenderer = new CustomRenderer(app.renderManager);
|
|
191
|
+
|
|
192
|
+
if (app.renderManager instanceof WebGpuRenderManager) { /* ... */ }
|
|
193
|
+
|
|
194
|
+
// Plain-object scene
|
|
195
|
+
app.start(new Scene({ update() { /* ... */ } }));
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
// After (0.6.0)
|
|
200
|
+
class GameScene extends Scene {
|
|
201
|
+
override draw(backend: RenderBackend): void {
|
|
202
|
+
this.root.render(backend);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const triangleRenderer = new CustomRenderer(app.backend);
|
|
207
|
+
|
|
208
|
+
if (app.backend instanceof WebGpuBackend) { /* ... */ }
|
|
209
|
+
|
|
210
|
+
// Anonymous-subclass scene (or named subclass)
|
|
211
|
+
app.start(new class extends Scene { override update() { /* ... */ } });
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## [0.5.1] - 2026-04-28
|
|
215
|
+
|
|
216
|
+
Rendering-pipeline performance pass. No public API changes; all
|
|
217
|
+
optimisations are internal to the renderer subsystem.
|
|
218
|
+
|
|
219
|
+
### Changed
|
|
220
|
+
|
|
221
|
+
- **WebGL2 sprite batching is now multi-texture.** A single batch can
|
|
222
|
+
bind up to eight textures (units 0..7); each vertex carries a uint
|
|
223
|
+
texture-slot attribute and the fragment shader's per-slot if-chain
|
|
224
|
+
selects the right sampler. Previously every texture change forced a
|
|
225
|
+
flush, capping multi-atlas scenes at roughly one batch per texture.
|
|
226
|
+
The vertex stride grows from 16 to 20 bytes (the new u32 slot at
|
|
227
|
+
offset 16 is the only addition); position, packed UV, and packed
|
|
228
|
+
RGBA8 tint are unchanged. Batches still flush on buffer-full,
|
|
229
|
+
blend-mode change, and now slot exhaustion (more than eight
|
|
230
|
+
textures in one batch).
|
|
231
|
+
- **WebGPU sprite vertex layout compacted from 28 to 24 bytes.** The
|
|
232
|
+
per-vertex `premultiplyAlpha` flag and `textureSlot` index
|
|
233
|
+
previously took one u32 attribute each; they are now packed into a
|
|
234
|
+
single u32 with the slot in bits 0..7 and the flag in bit 8. The
|
|
235
|
+
WGSL vertex shader unpacks via bit ops. 16 bytes saved per sprite.
|
|
236
|
+
- **Async-compile path now syncs the shader between buffer setup and
|
|
237
|
+
attribute lookup.** The 0.5.0+slice-C deferral of attribute /
|
|
238
|
+
uniform extraction from `initialize()` to first `sync()` broke
|
|
239
|
+
connect-time `getAttribute()` callers under a real WebGL2 context
|
|
240
|
+
(jest mocks didn't exercise that code path). Fixed in
|
|
241
|
+
`AbstractWebGl2BatchedRenderer`, `WebGl2PrimitiveRenderer`, and
|
|
242
|
+
`WebGl2MaskCompositor`. The driver still gets a parallel-compile
|
|
243
|
+
window between `shader.connect()` and `shader.sync()` thanks to
|
|
244
|
+
KHR_parallel_shader_compile; the eventual blocking status query is
|
|
245
|
+
a no-op when compile already finished.
|
|
246
|
+
|
|
247
|
+
### Added
|
|
248
|
+
|
|
249
|
+
- **`WebGl2SpriteRenderer.prewarmPipelines` equivalent for WebGPU.**
|
|
250
|
+
`WebGpuSpriteRenderer.prewarmPipelines(formats)` calls
|
|
251
|
+
`createRenderPipelineAsync` for every BlendMode × format combo in
|
|
252
|
+
parallel during render-manager init. The first draw of every common
|
|
253
|
+
blend mode no longer blocks on synchronous pipeline creation.
|
|
254
|
+
Renderers without a `prewarmPipelines` method continue to create
|
|
255
|
+
pipelines lazily on first use; the pre-warm fallback gracefully
|
|
256
|
+
no-ops when `createRenderPipelineAsync` isn't available (older
|
|
257
|
+
browsers, headless test mocks).
|
|
258
|
+
- **`KHR_parallel_shader_compile` opt-in for WebGL2 shader compile.**
|
|
259
|
+
When the extension is present (Chrome / Edge / Firefox by default,
|
|
260
|
+
Safari since 17) the GL driver may compile shaders on a worker
|
|
261
|
+
thread; status queries are deferred to the first `sync()` call so
|
|
262
|
+
the main thread doesn't block on compile.
|
|
263
|
+
- **`ShaderPrimitives.UnsignedInt`, `UnsignedIntVec2..4`** with their
|
|
264
|
+
byte-size and array-constructor mappings, so `getActiveAttrib` /
|
|
265
|
+
`getActiveUniform` on a `uint` shader slot resolves correctly. The
|
|
266
|
+
enum gains four members; the runtime export inventory is unchanged.
|
|
267
|
+
- **`WebGl2VertexArrayObject.addAttribute(..., integer)`** parameter
|
|
268
|
+
routes integer-typed shader inputs (`uint`, `uvec`) to
|
|
269
|
+
`vertexAttribIPointer` rather than `vertexAttribPointer`, so the
|
|
270
|
+
shader receives the raw integer value instead of a coerced float.
|
|
271
|
+
- **`RendererRegistry.renderers()`** iterator exposes the registered
|
|
272
|
+
renderers so backend managers can dispatch optional lifecycle hooks
|
|
273
|
+
(such as the WebGPU pipeline pre-warm above) without per-renderer
|
|
274
|
+
private-field reach-ins.
|
|
275
|
+
|
|
276
|
+
### Performance notes
|
|
277
|
+
|
|
278
|
+
- Sprite-heavy scenes with multiple atlases see a draw-call reduction
|
|
279
|
+
proportional to atlas count (up to 8×) on WebGL2.
|
|
280
|
+
- WebGPU sprite vertex bandwidth is reduced 14% (16 bytes per sprite).
|
|
281
|
+
- First-frame stutter from JIT shader / pipeline compilation is
|
|
282
|
+
largely eliminated when KHR_parallel_shader_compile (WebGL2) or
|
|
283
|
+
`createRenderPipelineAsync` (WebGPU) is supported.
|
|
284
|
+
|
|
285
|
+
## [0.5.0] - 2026-04-28
|
|
286
|
+
|
|
287
|
+
Three focused breaking changes targeted at the first pre-1.0 minor: a hierarchy-semantics boundary slice (per `.workspace/reviews/opus-pre-1.0-architecture-review/09-b1-implementation-rfc.md`), a unified mask API with full multi-source support (per `.workspace/reviews/opus-pre-1.0-architecture-review/10-mask-api-decision.md`), and a Scene API simplification that collapses the static factory into the constructor. No aliases.
|
|
288
|
+
|
|
289
|
+
### Removed
|
|
290
|
+
|
|
291
|
+
- **`Transformable` class and `TransformableFlags` enum.** Inlined into `SceneNode`. `SceneNode` now owns its transform fields and accessors (`position`, `x`, `y`, `rotation`, `scale`, `origin`, `setPosition`, `setRotation`, `setScale`, `setOrigin`, `move`, `rotate`, `getTransform`, `updateTransform`, `flags`) directly. The public surface shrinks by two symbols. `Flags<T>` (the generic class) remains public.
|
|
292
|
+
- **`SceneNode.render(runtime)` no-op.** Render belongs to `RenderNode` and below; bare `SceneNode` no longer pretends to participate in the render pass.
|
|
293
|
+
- **`Scene.create(definition)` static factory.** Replaced by a typed constructor overload — see Changed below.
|
|
294
|
+
|
|
295
|
+
### Changed
|
|
296
|
+
|
|
297
|
+
- **`RenderNode.render(runtime)` is now `abstract`.** All concrete subclasses (`Drawable`, `Container`, `Graphics`, `Sprite`, `AnimatedSprite`, `Text`, `Video`, `ParticleSystem`, `DrawableShape`) already implement it. The abstract declaration removes the SceneNode-render lie.
|
|
298
|
+
- **`RenderNode.mask` is now the unified visual masking API**, accepting any `MaskSource = Rectangle | Texture | RenderTexture | RenderNode | null`. The behavior depends on the source:
|
|
299
|
+
- `Rectangle` — fast axis-aligned scissor clip (O(1) GPU state). The most common case for UI panels and viewport regions.
|
|
300
|
+
- `Texture` / `RenderTexture` — uses the texture's alpha channel as the mask, stretched to fit the masked node's local bounds. The texture has no transform of its own; for transform/scale/rotation control over the mask source, use a `Sprite(texture)` instead.
|
|
301
|
+
- `RenderNode` (`Sprite`, `Graphics`, `Container`, etc.) — the node's full visual output (with its own transform, filters, cacheAsBitmap) is rendered into an intermediate render texture and used as the alpha mask. Bare `SceneNode` instances are rejected at compile time because they are structural-only.
|
|
302
|
+
- `null` — no mask.
|
|
303
|
+
|
|
304
|
+
Setting `node.mask = node` (self-mask) throws at runtime.
|
|
305
|
+
- **`SceneRenderRuntime` mask primitives renamed** to match the new vocabulary:
|
|
306
|
+
- `pushMask(maskBounds)` / `popMask()` → `pushScissorRect(bounds)` / `popScissorRect()` (lower-level scissor primitive used internally by the `Rectangle` mask path).
|
|
307
|
+
- New `composeWithAlphaMask(content, mask, x, y, width, height, blendMode)` — used internally by the Texture/RenderTexture/RenderNode mask paths.
|
|
308
|
+
- Backend implementations: `WebGl2MaskCompositor` (new) and `WebGpuMaskCompositor` (new) implement the alpha-compose pipeline. Each owns its own shader/pipeline, lazily initialized on first use, disconnected on manager destroy. Pipelines are cached per (target format, blend mode) on the WebGPU side.
|
|
309
|
+
- **`Container._children` narrowed to `Array<RenderNode>`.** `addChild`, `addChildAt`, `removeChild`, `swapChildren`, `getChildIndex`, `setChildIndex`, `getChildAt`, and `Scene.addChild`/`removeChild` now require `RenderNode` instances. Bare `SceneNode` instances cannot be added to a container at compile time. (Previous behavior added them as no-op render nodes; observable behavior was unchanged for any code that already added Drawable/Container/Graphics/Sprite/etc.)
|
|
310
|
+
- **`Scene` is now generic and constructable with an optional typed `SceneData` definition.** `class Scene<T extends SceneData = SceneData>` — `new Scene()` produces an empty scene; `new Scene({ update() { ... }, draw() { ... } })` accepts a typed definition object whose method bodies see `this` as `Scene<T> & T` via `ThisType<>`. `class extends Scene` is unchanged and remains the recommended path for stateful scenes — TypeScript only infers properties declared inside the definition object, so `this._foo = ...` assignments inside method bodies are still invisible to the type system without pre-declaration. The existing `SceneInstance<T>` type alias keeps its meaning (`Scene<T> & T`) and is still re-exported from the package root.
|
|
311
|
+
|
|
312
|
+
### Added
|
|
313
|
+
|
|
314
|
+
- **`MaskSource` type alias** is exported from the package root: `Rectangle | Texture | RenderTexture | RenderNode | null`. This is the public type for `RenderNode.mask`.
|
|
315
|
+
- **Root export runtime snapshot gate** (`test/core/root-index-snapshot.test.ts`). Captures every runtime-visible export name from `src/index.ts` and compares against a committed Jest snapshot. CI fails on any unintentional addition or removal.
|
|
316
|
+
- **Root export type-level inventory** (`test/core/root-index-type-inventory.test.ts`). Enumerates all exported symbols — including interfaces and type aliases erased at runtime — with their kind annotations.
|
|
317
|
+
- **RenderNode/SceneNode contract tests** (`test/rendering/render-node.test.ts`). Pin down the `SceneNode` is structural-only / `RenderNode.render` is abstract / `Container.addChild` rejects non-`RenderNode` contracts.
|
|
318
|
+
- **MaskSource union tests** (`test/rendering/mask-source.test.ts`). 12 tests covering: Rectangle scissor routing, nested rectangles, zero-size and null masks; Texture / RenderTexture / Sprite / Graphics / Container as alpha-mask sources; bare `SceneNode` rejected at compile time; self-mask rejected at runtime; mask reassignment to null.
|
|
319
|
+
|
|
320
|
+
### Migration
|
|
321
|
+
|
|
322
|
+
| Before (0.4.x) | After |
|
|
323
|
+
|---|---|
|
|
324
|
+
| `import { Transformable } from '@codexo/exojs'`; `class X extends Transformable` | `import { SceneNode } from '@codexo/exojs'`; `class X extends SceneNode` |
|
|
325
|
+
| `import { TransformableFlags } from '@codexo/exojs'` | Internal flag enum is no longer public; use SceneNode's high-level transform accessors instead. |
|
|
326
|
+
| `node.mask = anyShapeNode` *(silently clipped to bounding rect)* | `node.mask = anyShapeNode` *(now a real shape mask via alpha compositing — except bare SceneNode which is rejected at compile time)* |
|
|
327
|
+
| Want fast axis-aligned clipping? | `node.mask = new Rectangle(x, y, w, h)` |
|
|
328
|
+
| Want to clip with a texture's alpha channel? | `node.mask = texture` or `node.mask = renderTexture` |
|
|
329
|
+
| Want a transformed/positioned alpha mask? | `node.mask = new Sprite(texture)` (Sprite's transform/position/scale apply to the mask source) |
|
|
330
|
+
| `runtime.pushMask(rect)` / `runtime.popMask()` | `runtime.pushScissorRect(rect)` / `runtime.popScissorRect()` (renamed; behavior unchanged) |
|
|
331
|
+
| `class Group extends SceneNode { override render() {...} }` | `class Group extends RenderNode { override render() {...} }` |
|
|
332
|
+
| `class CustomContainer extends Container { override addChild(child: SceneNode) {...} }` | `class CustomContainer extends Container { override addChild(child: RenderNode) {...} }` |
|
|
333
|
+
| `Scene.create({ update() {...} })` | `new Scene({ update() {...} })` (drop-in replacement; same `this` typing via `ThisType<Scene & T>`) |
|
|
334
|
+
| `Scene.create({})` | `new Scene()` |
|
|
335
|
+
|
|
336
|
+
No deprecated aliases are provided. The migration is mechanical and the project is pre-1.0 with explicit "may break between minors" policy.
|
|
337
|
+
|
|
338
|
+
### Modernized
|
|
339
|
+
|
|
340
|
+
Quality-of-life cleanups using ES2022+ features. No public-API impact, but flagged here for transparency:
|
|
341
|
+
|
|
342
|
+
- **`Scene` uses ECMAScript `#` private fields** (`#app`, `#root`, `#stackMode`, `#inputMode`) instead of TypeScript `private _xxx`. True runtime privacy — fields are unreachable from outside the class even via bracket notation. The rest of the codebase still uses `private _xxx`; full sweep is queued for a future release pending test refactor (existing tests reach into private state via `obj['_field']`, which `#` fields block).
|
|
343
|
+
- **`Loader.ts` uses `Object.hasOwn(obj, key)`** instead of `Object.prototype.hasOwnProperty.call(obj, key)`. Same semantics, less ceremony.
|
|
344
|
+
- **`SceneManager` uses `array.at(-1)`** for stack-tail access instead of `arr[arr.length - 1]`. Three sites: the active-scene getter, `popScene`, and `_unloadCoveredScenes`.
|
|
345
|
+
- **`Loader.ts` uses `Error.cause`** for the wrapped error in `factory.create()` failures. `cause` carries the full original error (with stack trace) so DevTools, Sentry, etc. surface the underlying cause automatically. The wrapper message still contains the inner message for backward compatibility with consumers that string-match the error message.
|
|
346
|
+
|
|
347
|
+
### Performance notes
|
|
348
|
+
|
|
349
|
+
- `mask = Rectangle` is O(1) GPU scissor — free at scale.
|
|
350
|
+
- `mask = Texture` / `mask = RenderTexture` adds one intermediate render texture acquire and one composite pass per masked render.
|
|
351
|
+
- `mask = RenderNode` adds a second intermediate render texture acquire (to bake the mask node's visual output) plus the composite pass — so two extra passes per masked render. Use sparingly for high-frequency draws; consider `cacheAsBitmap` on the masked content.
|
|
352
|
+
|
|
353
|
+
### Notes
|
|
354
|
+
|
|
355
|
+
- The single dominant import model is intentional: `import { Application, Sprite } from '@codexo/exojs'` and `import * as Exo from '@codexo/exojs'` align with the IIFE/global bundle (`Exo.Application`, `Exo.Sprite`). Subpath exports are deferred until a stable API boundary warrants them.
|
|
356
|
+
- `SceneNode` is now a concrete structural class — transform, hierarchy, collision, culling. `RenderNode` (abstract) is the render-capable base. Every render-participating class extends `RenderNode`; bare `SceneNode` instances are valid as user-defined data nodes but cannot be added to containers.
|
|
357
|
+
|
|
358
|
+
## [0.4.0] - 2026-04-26
|
|
359
|
+
|
|
360
|
+
Pre-1.0 versioning reset. The active development line moves from `2.1.2` to `0.4.0` to honestly reflect that the public API is not yet stable. No runtime behavior change relative to the previous head — this release marks a versioning policy shift, not a code rewrite.
|
|
361
|
+
|
|
362
|
+
### Notes
|
|
363
|
+
|
|
364
|
+
- The `2.x` releases (`2.0.0`, `2.1.0`, `2.1.1`, `2.1.2`) remain published on npm as a historical line and will be deprecated with a pointer to the `0.x` line.
|
|
365
|
+
- New work happens on the `0.x` line. Expect breaking changes between `0.x` minors as the scene graph, renderer, and resource boundaries continue to evolve.
|
|
366
|
+
- `1.0.0` will mark the first stable public API contract. Until then, treat any minor version as potentially breaking and pin exact versions in downstream experiments.
|
|
367
|
+
- Current package identity for the reset line is `@codexo/exojs`. Historical `2.x` release notes may reference the legacy package/import name, old example layout, old scripts, or the former `master` branch target.
|
|
368
|
+
- The `2.1.0` View camera note below used the old working name `setBoundsConstraint`; the current API is `setBounds(...)` / `clearBounds()`.
|
|
369
|
+
- Past CHANGELOG entries for `2.x` are otherwise preserved below as the historical record of work that landed in those releases.
|
|
370
|
+
|
|
371
|
+
## [2.1.2] - 2026-04-19
|
|
372
|
+
|
|
373
|
+
Patch release with one runtime fix, a toolchain modernization pass, and a legacy-artifact cleanup. No public API removals or renames.
|
|
374
|
+
|
|
375
|
+
### Fixed
|
|
376
|
+
|
|
377
|
+
- **`Signal.dispatch` skipped sibling `once()` handlers.** `once()` wrappers self-remove mid-iteration, which compacts the underlying bindings array; the `for..of` iterator then advanced past the binding that shifted into the just-visited slot. `dispatch` now iterates a snapshot of bindings, so handler-driven mutation is safe. Visible symptom: the Audio Visualisation example received a set-up `Music` but an un-set-up `AudioAnalyser`, so frequency buffers stayed at zero.
|
|
378
|
+
|
|
379
|
+
### Changed
|
|
380
|
+
|
|
381
|
+
- Removed the legacy bundled declaration file `dist/exo.d.ts` (emitted via `tsc --outFile` + `module: amd`, both deprecated in TypeScript 6). Modern consumers resolve types through `exports["."].types`, which points at the per-file tree in `dist/esm/`; `dist/exo.d.ts` was never part of the `exports` map. This also removes the `ignoreDeprecations: "6.0"` escape hatch from the build.
|
|
382
|
+
- Build upgraded to TypeScript 6, ESLint 10, Jest 30. Internal imports now use the `@/*` path alias (mapped to `src/*`) and `baseUrl` is no longer required.
|
|
383
|
+
|
|
384
|
+
## [2.1.1] - 2026-04-19
|
|
385
|
+
|
|
386
|
+
Patch release fixing a cluster of WebGPU and scene-graph bugs discovered after 2.1.0 shipped. No public API removals or renames; one backward-compatible addition on `Container.addChild`.
|
|
387
|
+
|
|
388
|
+
### Fixed
|
|
389
|
+
|
|
390
|
+
- **WebGPU adapter ordering.** `WebGpuRenderManager` now requests the GPU adapter before acquiring the canvas WebGPU context. A null adapter previously locked the canvas into WebGPU mode, preventing `Application`'s automatic WebGL2 fallback from obtaining a context on the same element.
|
|
391
|
+
- **WebGL2 shader program binding.** `WebGl2ShaderRuntime.sync()` now binds the program before writing uniforms. The previous draw pipeline never called `bindShader(shader)` with a non-null shader, so every `uniform*` write targeted the wrong or null program and `drawElements` reported "no valid shader program in use". Exposed by the WebGPU adapter fallback above.
|
|
392
|
+
- **WGSL multi-texture sprite shader** uses `textureSampleGrad` with explicit screen-space derivatives. `textureSample`'s uniformity requirement prevented the 8-slot dispatch from compiling on any sprite batch spanning more than one texture slot.
|
|
393
|
+
- **Sprite index buffer** allocation and lifecycle. Buffer size was 4× larger than intended (`indexData.byteLength * BYTES_PER_ELEMENT` instead of `indexData.byteLength`), and `_ensureBatchCapacity` ran inside the draw loop and could destroy a buffer the render pass had already bound. Capacity is now grown once up front.
|
|
394
|
+
- **Sprite multi-batch rendering.** When a flush contained multiple batches (blend-mode change, texture-slot overflow, or pipeline switch), each batch's `queue.writeBuffer(vertexBuffer, offset: 0, ...)` serialised before the single submit, leaving only the last batch's vertex data in the buffer. All batch vertex data is now packed into one CPU buffer at distinct sprite offsets and uploaded once; `drawIndexed` uses `firstIndex` to target each range.
|
|
395
|
+
- **Particle and primitive multi-drawcall rendering.** Same multi-write-to-offset-0 pattern, plus mid-loop `_ensureCapacity` destroying buffers still referenced by the pass. Particle renderer now submits one command buffer per system. Primitive renderer was rewritten: CPU bakes `view * globalTransform` into `vec4` clip-space positions per vertex, pipeline has no bind-group, one render pass per flush with packed vertex/index buffers.
|
|
396
|
+
- **Primitive combine order.** `_combinedTransform.copy(view).combine(global)` produced `global * view` (`Matrix.combine` applies the argument on the left, confirmed by `SceneNode.getGlobalTransform` which chains `local.combine(parent.global)` to yield `parent.global * local`). Swapped to `copy(global).combine(view)` = `view * global`.
|
|
397
|
+
- **WebGPU mipmap generation.** The full-screen downsample triangle's UVs are no longer Y-flipped relative to framebuffer orientation. Every odd mip level was being rendered upside-down, producing a visible sprite flip whenever the view zoomed far enough for the LOD selector to cross an odd/even boundary.
|
|
398
|
+
|
|
399
|
+
### Added
|
|
400
|
+
|
|
401
|
+
- `Container.addChild` accepts multiple children via rest args (`addChild(...children)`). The previous single-argument signature silently dropped the tail of `addChild(a, b, c, d)`; callers only saw `a` in the scene graph. Single-child usage stays backward compatible.
|
|
402
|
+
- Doc comment on `ParticleOptions.position` clarifying it is in the owning `ParticleSystem`'s local coordinate space. The shader applies the system's global transform on top, so passing world coordinates double-translates the emitter.
|
|
403
|
+
|
|
404
|
+
## [2.1.0] - 2026-04-18
|
|
405
|
+
|
|
406
|
+
Product-readiness release. Additive across assets, game-feel, visuals, performance, optional physics, and WebGPU parity. No public contracts were removed or renamed since v2.0.0.
|
|
407
|
+
|
|
408
|
+
### Highlights
|
|
409
|
+
|
|
410
|
+
- Typed asset manifests and bundle loading workflow.
|
|
411
|
+
- `AnimatedSprite` with named clips, loop control, and frame signals.
|
|
412
|
+
- Scene stacking with participation policies, input routing, and fade transitions.
|
|
413
|
+
- View/camera polish: follow with lerp, bounds clamp, zoom, shake.
|
|
414
|
+
- Audio sprites and sound pooling.
|
|
415
|
+
- Visual capability wave: filter pipeline, masking, render passes, cache-as-bitmap, multi-texture batching on the WebGPU backend.
|
|
416
|
+
- Automatic off-screen culling with observable render stats.
|
|
417
|
+
- Optional Rapier physics integration behind an optional peer dependency.
|
|
418
|
+
- WebGPU parity improvements and clearer initialization failure semantics.
|
|
419
|
+
- Docs and examples overhaul; release verification hardening.
|
|
420
|
+
|
|
421
|
+
### Assets / workflow
|
|
422
|
+
|
|
423
|
+
- `defineAssetManifest`, `AssetEntry`, and `loadBundle` with progress callbacks.
|
|
424
|
+
- `BundleLoadError` surfaces per-entry failures with the responsible loader token.
|
|
425
|
+
- Strict manifest validation runs at definition time.
|
|
426
|
+
- `CacheStore` + `IndexedDbStore` remain the persistence path; strategy classes (`CacheFirstStrategy`, `NetworkOnlyStrategy`) are exposed for custom pipelines.
|
|
427
|
+
|
|
428
|
+
### Game-feel
|
|
429
|
+
|
|
430
|
+
- `AnimatedSprite`: `defineClip`, `setClips`, `play`, `stop`, `loop` override, `onComplete` and `onFrame` signals.
|
|
431
|
+
- `SceneManager` is now a real stack: `pushScene`, `popScene`, `setScene` with resolved `SceneParticipationPolicy` covering stack mode and input mode.
|
|
432
|
+
- `SceneInputEvent` routing honours stack participation so overlay/modal scenes can intercept input cleanly.
|
|
433
|
+
- Fade transitions integrated into scene switching.
|
|
434
|
+
- `View` camera: `follow` with lerp, `setBoundsConstraint`, `zoom`/`setZoom`, `shake` with decay and configurable frequency.
|
|
435
|
+
- `Sound`: `setPoolSize`, `playPooled`, `stopPooled`, `defineSprite`, `setSprites` for audio-sprite playback.
|
|
436
|
+
|
|
437
|
+
### Rendering / visuals
|
|
438
|
+
|
|
439
|
+
- Filter pipeline: abstract `Filter` base with `BlurFilter` and `ColorFilter` implementations; per-node filter chains wired through the render runtime.
|
|
440
|
+
- Masking support in both render managers and on `RenderNode`.
|
|
441
|
+
- Render-pass composition: `RenderTargetPass`, `CallbackRenderPass`, `RenderTarget`, and the existing `RenderTexture` for off-screen work.
|
|
442
|
+
- `RenderNode.cacheAsBitmap` flattens expensive subtrees to a cached texture with invalidation.
|
|
443
|
+
- `Container.sortableChildren` + `SceneNode.zIndex` provide depth-sorted rendering with a stable fallback on insertion order.
|
|
444
|
+
- Multi-texture batching on the WebGPU sprite renderer (`textureSlots`, `maxBatchTextures`). See caveat below.
|
|
445
|
+
- WebGPU sprite, particle, and primitive renderers reached functional parity with the WebGL2 equivalents.
|
|
446
|
+
- Context-loss handling preserved.
|
|
447
|
+
|
|
448
|
+
### Performance
|
|
449
|
+
|
|
450
|
+
- Automatic off-screen culling: `Drawable` checks `inView(view)` each frame and counts skipped nodes.
|
|
451
|
+
- `RenderStats` exposes `submittedNodes`, `culledNodes`, `drawCalls`, `batches`, `renderPasses`, and `frameTimeMs` for observability.
|
|
452
|
+
- Hot-path cleanup across the renderers.
|
|
453
|
+
- `npm run perf:benchmark` runs the rendering benchmark harness under `test/perf/`.
|
|
454
|
+
|
|
455
|
+
### Physics
|
|
456
|
+
|
|
457
|
+
- Optional Rapier integration via `createRapierPhysicsWorld({ gravityY })`.
|
|
458
|
+
- `@dimforge/rapier2d-compat` is declared as an optional `peerDependency`; apps that do not import the physics entry point incur zero runtime cost.
|
|
459
|
+
- Collision groups/masks encoded into Rapier's 16/16 packed format; `PhysicsCollisionFilter` lets you declare membership and what each body collides with.
|
|
460
|
+
- Triggers vs. solid colliders distinguished via `trigger` on the descriptor; `onTriggerEnter` / `onTriggerExit` signals on the body.
|
|
461
|
+
- Transform sync helpers and a `createDebugGraphics`/`updateDebugGraphics` path for debug draw through the existing `Graphics` primitive.
|
|
462
|
+
|
|
463
|
+
### WebGPU
|
|
464
|
+
|
|
465
|
+
- Sprite, particle, and primitive renderers now cover the WebGL2 feature surface used by the scene runtime.
|
|
466
|
+
- Explicit `backend: { type: 'webgpu' }` errors out if WebGPU is unavailable or initialization fails — failures are not silently swallowed.
|
|
467
|
+
- `backend: { type: 'auto' }` prefers WebGPU when `navigator.gpu` is present and falls back to WebGL2 only when the WebGPU init path throws.
|
|
468
|
+
- Initialization error paths are now observable through the thrown error rather than partially constructed state.
|
|
469
|
+
|
|
470
|
+
### Docs / examples
|
|
471
|
+
|
|
472
|
+
- README rewritten to match the shipped surface.
|
|
473
|
+
- New docs hub under `docs/` with sections for getting-started, core-concepts, assets, scenes, rendering, audio, physics, performance, and examples.
|
|
474
|
+
- New class-focused API pages: `Application`, `Renderer`, `Graphics`, `AnimatedSprite`, `AssetManifests`, `Audio`, `View`, `VisualEffects`, `PhysicsRapier`, `Performance`, `GameFeel`.
|
|
475
|
+
- `examples/` folder contains focused source snippets (`01-quickstart.ts` … `08-physics-rapier.ts`) that are typechecked against the public API via `tsconfig.examples.json`.
|
|
476
|
+
|
|
477
|
+
### Tooling / release quality
|
|
478
|
+
|
|
479
|
+
- `npm run typecheck:examples` typechecks the in-repo examples against `src/` to prevent example drift.
|
|
480
|
+
- `npm run verify:exports` validates the package entry graph (`scripts/verify-exports.mjs`).
|
|
481
|
+
- `npm run verify:package` runs build → example typecheck → export verification → `npm pack --dry-run`.
|
|
482
|
+
- `npm run verify:release` is the smallest release gate: typecheck → lint → tests → verify:package.
|
|
483
|
+
- CI runs lint, typecheck, tests, bundle build, declaration build, example typecheck, export verification, and pack dry-run on every PR to `master`.
|
|
484
|
+
|
|
485
|
+
### Behaviour changes worth knowing
|
|
486
|
+
|
|
487
|
+
These are minor-level behaviour changes, not source-breaks; flagged here for transparency:
|
|
488
|
+
|
|
489
|
+
- **Automatic culling**: nodes whose `inView(view)` check is false are no longer submitted and are counted in `RenderStats.culledNodes`. Apps that were already relying on correct bounds see no observable change. If a custom drawable under-reports its bounds, it may now be skipped when it was previously drawn off-screen.
|
|
490
|
+
- **Scene input routing**: with the new stack, input dispatch honours the resolved `SceneInputMode` of each stack entry. Apps that only use `setScene(...)` with no `pushScene` keep single-scene v2.0.0 behaviour.
|
|
491
|
+
- **Explicit WebGPU failures**: `backend: { type: 'webgpu' }` now throws rather than silently picking WebGL2. Apps that want the old "try WebGPU, otherwise WebGL2" behaviour should use `backend: { type: 'auto' }`.
|
|
492
|
+
|
|
493
|
+
### Known limitations / honest caveats
|
|
494
|
+
|
|
495
|
+
- **WebGL2 is still single-texture batched.** Multi-texture batching is implemented only in the WebGPU sprite renderer. WebGL2 sprite-heavy scenes will still flush on texture changes.
|
|
496
|
+
- **WebGPU is improved, not "production WebGPU".** Treat the WebGPU backend as functional parity with WebGL2 for the features this library ships, not as a general-purpose WebGPU renderer.
|
|
497
|
+
- **Rapier is optional.** If you never import the physics entry point, Rapier is not installed or loaded. It is not bundled with the library.
|
|
498
|
+
- **Tilemaps are not in scope.** There is no built-in tilemap renderer; engines targeting Tiled-centric games should continue to reach for dedicated tooling.
|
|
499
|
+
- **Bitmap fonts are not shipped.** `Text` renders via Canvas with stroke support; `BitmapText` is not included.
|
|
500
|
+
- **No tween library.** Animation curves and tween orchestration are left to consumer code or external libraries.
|
|
501
|
+
- **Audio remains Web Audio decoded/streaming with pooling and sprites.** Spatial audio (`PannerNode`), effects (`ConvolverNode`, `BiquadFilterNode`, `DynamicsCompressorNode`), and fade helpers are not part of this release.
|
|
502
|
+
- **Particles are still CPU-simulated.** The WebGPU particle renderer is a rendering path, not a GPU compute simulator.
|
|
503
|
+
- **Graphics: no gradients, patterns, caps/joins, or dashing.** Basic fills and strokes only.
|
|
504
|
+
- **Input gaps unchanged from 2.0.0**: no haptics/vibration, no rebinding capture, no gesture library, fixed gamepad dead zones.
|
|
505
|
+
|
|
506
|
+
### Upgrading from 2.0.0
|
|
507
|
+
|
|
508
|
+
No code changes are required for typical applications. Review the behaviour-change notes above if your code:
|
|
509
|
+
|
|
510
|
+
- requests `backend: { type: 'webgpu' }` explicitly and was relying on silent fallback,
|
|
511
|
+
- implements a custom `Drawable` with inexact bounds,
|
|
512
|
+
- pushed multiple scenes via manual orchestration outside `SceneManager`.
|
|
513
|
+
|
|
514
|
+
## [2.0.0] - previous major
|
|
515
|
+
|
|
516
|
+
Baseline for the modernized architecture wave (renderer runtime, scene runtime, class-token loader v2, math and rendering contract renames).
|