babylon.quarks 0.25.0 → 0.26.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/CHANGELOG.md CHANGED
@@ -4,6 +4,91 @@ All notable changes to the `babylon.quarks` package are documented here.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
5
  and the project follows the `quarks.core` 0.x version line.
6
6
 
7
+ ## [0.26.0] — 2026-10-21
8
+
9
+ ### Changed (breaking)
10
+
11
+ The texture effects of 0.25 are redesigned on the concepts Unity and Unreal use, so that one
12
+ model covers every texture a particle samples. Effects and code written against 0.25 need the
13
+ renames below.
14
+
15
+ - `ParticleSystem.gradientMap` is now a `ParticleGradientMap` `{ramp, channel}` instead of a bare
16
+ texture. `channel` (`'r'` default, `'g'`, `'b'`, `'a'`, `'luminance'`) picks the texel value
17
+ the ramp is looked up by, so channel-packed and coloured textures work as well as greyscale ones.
18
+ Looked up by `'a'`, the ramp's alpha replaces the map's, so a soft shape can glow at its fringe
19
+ and stay solid at its heart. JSON: `gradientMap: {ramp: <texture uuid>, channel}`.
20
+ - `ParticleSystem.uvScroll` is replaced by `mapUV`, a `TextureUV` that lays the main map (tiling,
21
+ offset, scroll, and UV channel 1). JSON: `mapUV` on the material, only the fields that differ from
22
+ the default. The `UV_SCROLL` define and `uvScrollOffset` uniform become `MAP_TRANSFORM` and
23
+ `mapTransform` (`uv * xy + zw`), with `MAP_UV1` when the map reads channel 1.
24
+ - `ParticleErosion.maskScroll` is replaced by `maskUV`, a `TextureUV`.
25
+ - Shader uniforms: `erosionParams` is a `vec2` (softness, edge width) and the mask is laid by
26
+ `erosionMaskTransform`. The gradient map adds `gradientMapChannel`.
27
+ - 0.25 JSON is not migrated: a bare-texture `gradientMap`, `uvScroll`, and `erosion.maskScroll` are
28
+ ignored on load. Re-export those effects.
29
+
30
+ ### Added
31
+
32
+ - **UV channels** (`UVChannel`: `0 | 1`), as Unity's UV channels and Niagara's ribbon UV0/UV1:
33
+ - Channel 0 is the map's UV as drawn.
34
+ - Channel 1 is the particle's own UV, which the sprite sheet never moves:
35
+ - the whole quad on billboards, stretched billboards and beams;
36
+ - along and across the trail on trails;
37
+ - the mesh's second UV set on meshes.
38
+ - A texture on channel 1 can run once across a whole trail or mesh however the map repeats or
39
+ animates. Shaders declare `vUV1` under `UV1` only when a texture reads it.
40
+ - **Second UV set on mesh particles:** `instancingUVs2` (glTF `TEXCOORD_1`, Unity's `uv2`).
41
+ - It is saved with the geometry as `uvs2` and read from three.js `uv1`/`uv2` attributes by the
42
+ loader.
43
+ - Systems batch by both UV sets.
44
+ - A mesh without a second set reads its first on channel 1. A set whose length is not two values
45
+ per vertex is left out with a one-time warning.
46
+ - `ParticleSystem.instancingUVs` and `instancingUVs2` accessors. Assigning `instancingGeometry`
47
+ with a different vertex count resets the first set to zeros and drops the second, so assign
48
+ the UVs after the geometry.
49
+ - **`TextureUV`** (`channel`, `tiling`, `offset`, `scroll`) lays a texture over the particle:
50
+ Unity's Tiling/Offset plus Unreal's Panner. `mapUV`, `erosion.maskUV` and `uvDistortion.mapUV`
51
+ take it. The offset is kept as given; only the scroll's share is wrapped.
52
+ JSON writes only the fields that differ from the default. Helpers: `normalizeTextureUV`,
53
+ `textureUVEqual`, `textureUVToJSON`.
54
+ - **`ParticleSystem.tint`** (`Vector4`, runtime only, copied by `clone()`):
55
+ - Multiplies every particle's colour and alpha as drawn, without touching the particles or
56
+ splitting batches.
57
+ - Use it for a per-instance colour or fade driven from code, like Unreal's user parameters.
58
+ With erosion, alpha is the erosion level.
59
+ - Additive and premultiplied blending ignore alpha; fade those through the colour instead.
60
+ - quarks.core `FrameOverLife` option **`random`** (FPS mode, with `frameCount`; saved in JSON only
61
+ when set):
62
+ - Every `1 / fps` seconds it shows a random frame of the segment instead of the next.
63
+ - Each particle has its own sequence.
64
+ - Like Cascade's random SubUV, for the flicker of lightning, sparks and neon.
65
+ - Mesh particle **rim mode `'fade'`** (Fresnel to opacity):
66
+ - Faces turned to the camera fade by `strength` instead of gaining a colour.
67
+ - A wall of light reads thick along its silhouette and thin across its face.
68
+ - **`ParticleSystem.uvDistortion`** (`ParticleUVDistortion`: noise `map`, `mapUV` (default
69
+ scroll `[0, 0.5]`), `strength`;
70
+ saved with the material only when set):
71
+ - A scrolling noise texture pushes the map's UV about, for heat shimmer and licking, breathing
72
+ shapes.
73
+ - Works on sprites, meshes and trails, in GLSL and WGSL.
74
+ - quarks.core **`TrailSettings.sideAxis`** (JSON `[x, y, z]`, written only when set):
75
+ - The trail is swept along that emitter axis instead of facing the camera.
76
+ - Each sample records the axis as the emitter held it, so a trail on a blade is the surface the
77
+ blade swept, like Unreal's AnimTrail.
78
+ - `TrailParticle.historySides` holds the recorded sides.
79
+
80
+ ### Fixed
81
+
82
+ - **Scrolls wrap over two repeats instead of one** in every `TextureUV`. A map with mirrored addressing no longer flips to its mirror image at every wrap.
83
+ - **Systems that share positions but not UVs batch apart.** Before, the first system's UVs drew
84
+ for both. Systems given a geometry without UVs share one fallback array per geometry, so they
85
+ still batch together.
86
+ - **Mesh systems that share positions but not normals batch apart.** Before, the first system's
87
+ normals lit both. Fallback normals are shared per geometry, and trails no longer split batches
88
+ over instanced UVs they never read.
89
+ - **Assigning `instancingGeometry` replaces stale normals and fallback UVs**: normals of a different
90
+ vertex count, and the previous geometry's fallbacks, move to the new geometry's.
91
+
7
92
  ## [0.25.0] — 2026-10-20
8
93
 
9
94
  ### Added