reze-engine 0.57.2 → 0.57.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.
@@ -1 +1 @@
1
- {"version":3,"file":"trails.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/trails.ts"],"names":[],"mappings":"AA4BA,KAAK,WAAW,GAAG;IACjB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb;oEACgE;IAChE,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAA;IAClB,8DAA8D;IAC9D,KAAK,EAAE,OAAO,GAAG,UAAU,CAAA;IAC3B,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAKjF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE;IACJ,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,EAAE,CAAA;IACf;;;;kFAI8E;IAC9E,SAAS,EAAE,OAAO,CAAA;CACnB,GACA,MAAM,CAsVR"}
1
+ {"version":3,"file":"trails.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/trails.ts"],"names":[],"mappings":"AA4BA,KAAK,WAAW,GAAG;IACjB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb;oEACgE;IAChE,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAA;IAClB,8DAA8D;IAC9D,KAAK,EAAE,OAAO,GAAG,UAAU,CAAA;IAC3B,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAKjF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE;IACJ,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,EAAE,CAAA;IACf;;;;kFAI8E;IAC9E,SAAS,EAAE,OAAO,CAAA;CACnB,GACA,MAAM,CA6WR"}
@@ -69,6 +69,10 @@ const SUB: i32 = ${TRAIL_SUBDIVISIONS};
69
69
  // scaling width pinches the strip shut at exactly the moments a hand decelerates,
70
70
  // which is every turn — and a ribbon that closes to nothing at each turn reads as
71
71
  // dark breaks in the middle of it.
72
+ /** How far a bone may travel between two trail samples, as a fraction of its
73
+ * owner's bounding radius. Generous on purpose: a hard swing covers a fraction
74
+ * of this, and the only things above it are cuts. */
75
+ const RZ_TRAIL_MAX_STEP: f32 = 0.5;
72
76
  const RZ_REF_SPAN: f32 = 0.37;
73
77
 
74
78
  struct CameraU {
@@ -262,9 +266,28 @@ fn vs(@builtin(vertex_index) vi: u32, @builtin(instance_index) ii: u32) -> VSOut
262
266
  // where the hand slows — aggregation the width taper never clamps, because
263
267
  // width follows AGE, not speed. Where the hand is not moving there is no path,
264
268
  // and a path effect should draw nothing there at all.
269
+ // AND A GATE AT THE OTHER END, for the same reason. The minimum says "the
270
+ // hand is not moving"; this says "the hand did not move THERE". A bone cannot
271
+ // cross a sizeable fraction of its owner between two samples, so a span that
272
+ // large is not a motion — it is a cut: a seek, a clip boundary, a model
273
+ // repositioned, a motion that jumps. Joined anyway, the two samples either
274
+ // side are bridged by one enormous quad flung across the gap and drawn at full
275
+ // strength, which is the "trail teleports on a fast move" report. A path
276
+ // effect should draw nothing across a discontinuity, exactly as it draws
277
+ // nothing where there is no path.
278
+ //
279
+ // Measured against the subject's own bounding radius rather than in world
280
+ // units, so it holds for a doll and for a giant, and it is checked in WORLD
281
+ // space rather than in pixels — a camera cut moves every projected point at
282
+ // once and must not shred every ribbon on screen.
283
+ //
284
+ // Zero radius means the cast slot is not live, and then there is nothing to
285
+ // measure against: the test stands down rather than rejecting everything.
286
+ let reach = rzSubject(subject).bounds.w * RZ_TRAIL_MAX_STEP;
265
287
  let c1 = cam.proj * cam.view * vec4f(p1, 1.0);
266
288
  let c2 = cam.proj * cam.view * vec4f(p2, 1.0);
267
289
  if (c1.w <= 0.01 || c2.w <= 0.01 ||
290
+ (reach > 0.0 && distance(p1, p2) > reach) ||
268
291
  distance(c1.xy / c1.w * toPx, c2.xy / c2.w * toPx) < 0.7 * (H / 1080.0)) {
269
292
  out.clip = vec4f(0.0, 0.0, -2.0, 1.0);
270
293
  out.uv = vec2f(0.0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reze-engine",
3
- "version": "0.57.2",
3
+ "version": "0.57.3",
4
4
  "description": "A lightweight WebGPU engine for real-time 3D MMD/PMX model rendering",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -120,6 +120,10 @@ const SUB: i32 = ${TRAIL_SUBDIVISIONS};
120
120
  // scaling width pinches the strip shut at exactly the moments a hand decelerates,
121
121
  // which is every turn — and a ribbon that closes to nothing at each turn reads as
122
122
  // dark breaks in the middle of it.
123
+ /** How far a bone may travel between two trail samples, as a fraction of its
124
+ * owner's bounding radius. Generous on purpose: a hard swing covers a fraction
125
+ * of this, and the only things above it are cuts. */
126
+ const RZ_TRAIL_MAX_STEP: f32 = 0.5;
123
127
  const RZ_REF_SPAN: f32 = 0.37;
124
128
 
125
129
  struct CameraU {
@@ -313,9 +317,28 @@ fn vs(@builtin(vertex_index) vi: u32, @builtin(instance_index) ii: u32) -> VSOut
313
317
  // where the hand slows — aggregation the width taper never clamps, because
314
318
  // width follows AGE, not speed. Where the hand is not moving there is no path,
315
319
  // and a path effect should draw nothing there at all.
320
+ // AND A GATE AT THE OTHER END, for the same reason. The minimum says "the
321
+ // hand is not moving"; this says "the hand did not move THERE". A bone cannot
322
+ // cross a sizeable fraction of its owner between two samples, so a span that
323
+ // large is not a motion — it is a cut: a seek, a clip boundary, a model
324
+ // repositioned, a motion that jumps. Joined anyway, the two samples either
325
+ // side are bridged by one enormous quad flung across the gap and drawn at full
326
+ // strength, which is the "trail teleports on a fast move" report. A path
327
+ // effect should draw nothing across a discontinuity, exactly as it draws
328
+ // nothing where there is no path.
329
+ //
330
+ // Measured against the subject's own bounding radius rather than in world
331
+ // units, so it holds for a doll and for a giant, and it is checked in WORLD
332
+ // space rather than in pixels — a camera cut moves every projected point at
333
+ // once and must not shred every ribbon on screen.
334
+ //
335
+ // Zero radius means the cast slot is not live, and then there is nothing to
336
+ // measure against: the test stands down rather than rejecting everything.
337
+ let reach = rzSubject(subject).bounds.w * RZ_TRAIL_MAX_STEP;
316
338
  let c1 = cam.proj * cam.view * vec4f(p1, 1.0);
317
339
  let c2 = cam.proj * cam.view * vec4f(p2, 1.0);
318
340
  if (c1.w <= 0.01 || c2.w <= 0.01 ||
341
+ (reach > 0.0 && distance(p1, p2) > reach) ||
319
342
  distance(c1.xy / c1.w * toPx, c2.xy / c2.w * toPx) < 0.7 * (H / 1080.0)) {
320
343
  out.clip = vec4f(0.0, 0.0, -2.0, 1.0);
321
344
  out.uv = vec2f(0.0);