reze-engine 0.68.28 → 0.68.31

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/model.d.ts CHANGED
@@ -176,9 +176,16 @@ export declare class Model {
176
176
  get rotation(): Quat;
177
177
  /** Uniform scale (default 1). Used to fit a stage.pmx to the character. */
178
178
  get scale(): number;
179
- /** Whether this model renders. Hidden models skip the main, shadow, and pick passes;
180
- * physics keeps running so they resume consistently. */
179
+ /** Whether the HOST shows this model — what setVisible last said. A playing
180
+ * motion can hide her on top of this (see `drawn`), and never writes here,
181
+ * so the host's own switch reads back exactly as it set it. */
181
182
  get visible(): boolean;
183
+ /** Whether this model renders this frame: the host shows her and the motion
184
+ * has not hidden her. Hidden models skip the main, shadow and pick passes;
185
+ * physics keeps running so they resume consistently. */
186
+ get drawn(): boolean;
187
+ /** Whether the playing motion has her hidden right now (VMD's 表示 flag). */
188
+ get hiddenByMotion(): boolean;
182
189
  setPosition(position: Vec3): void;
183
190
  setRotation(rotation: Quat): void;
184
191
  setScale(scale: number): void;
@@ -227,6 +234,8 @@ export declare class Model {
227
234
  private _rotation;
228
235
  private _scale;
229
236
  private _visible;
237
+ /** The playing clip's display flag at the current frame — see `drawn`. */
238
+ private motionHidden;
230
239
  private rootMatrixValues;
231
240
  private rootMatrixDirty;
232
241
  private rootIsIdentity;
@@ -642,6 +651,9 @@ export declare class Model {
642
651
  /** Step the IK state to `frame`. VMD IK keys are steps: a state holds until
643
652
  * the next one changes it, so this is a lookup, not an interpolation. */
644
653
  private applyIkFromClip;
654
+ /** Step the motion's display flag to `frame`. Before its first key she is
655
+ * shown — MMD's own reading of a motion that starts hidden later. */
656
+ private applyVisibilityFromClip;
645
657
  /** Sample one bone track at `frame` into outRot + outVmdTrans. The translation is
646
658
  * VMD-space (bind-relative), NOT yet converted to bone-local — callers convert with
647
659
  * convertVMDTranslationToLocal once they know the final rotation. The cursor cache
@@ -1 +1 @@
1
- {"version":3,"file":"model.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MAAM,EAAE,SAAS,UAAO,GAAG,OAAO;IAwHpD,OAAO,CAAC,aAAa;IAyCrB,OAAO,CAAC,aAAa,CAAyB;IAI9C,OAAO,CAAC,4BAA4B;IA4HpC;;;;;;;;;;;;;;;;;OAiBG;IACH,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI;IAkDlD;kFAC8E;IAC9E,oBAAoB,IAAI,MAAM,EAAE;IAIhC;;;;;;;;;;;;;;;OAeG;IACH,kBAAkB,IAAI,IAAI;IA4C1B,oBAAoB,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI;CA0GhD"}
package/dist/model.js CHANGED
@@ -70,11 +70,22 @@ export class Model {
70
70
  get scale() {
71
71
  return this._scale;
72
72
  }
73
- /** Whether this model renders. Hidden models skip the main, shadow, and pick passes;
74
- * physics keeps running so they resume consistently. */
73
+ /** Whether the HOST shows this model — what setVisible last said. A playing
74
+ * motion can hide her on top of this (see `drawn`), and never writes here,
75
+ * so the host's own switch reads back exactly as it set it. */
75
76
  get visible() {
76
77
  return this._visible;
77
78
  }
79
+ /** Whether this model renders this frame: the host shows her and the motion
80
+ * has not hidden her. Hidden models skip the main, shadow and pick passes;
81
+ * physics keeps running so they resume consistently. */
82
+ get drawn() {
83
+ return this._visible && !this.motionHidden;
84
+ }
85
+ /** Whether the playing motion has her hidden right now (VMD's 表示 flag). */
86
+ get hiddenByMotion() {
87
+ return this.motionHidden;
88
+ }
78
89
  setPosition(position) {
79
90
  this._position.set(position);
80
91
  this.rootMatrixDirty = true;
@@ -168,6 +179,8 @@ export class Model {
168
179
  this._rotation = Quat.identity();
169
180
  this._scale = 1;
170
181
  this._visible = true;
182
+ /** The playing clip's display flag at the current frame — see `drawn`. */
183
+ this.motionHidden = false;
171
184
  this.rootMatrixValues = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
172
185
  this.rootMatrixDirty = false;
173
186
  this.rootIsIdentity = true;
@@ -1630,6 +1643,11 @@ export class Model {
1630
1643
  for (const track of ikTracks.values())
1631
1644
  track.sort((a, b) => a.frame - b.frame);
1632
1645
  clip.ikTracks = ikTracks;
1646
+ // The same records carry the model's 表示 flag. Kept only when some
1647
+ // record hides her: a motion that never does plays exactly as before.
1648
+ if (ikFrames.some((r) => !r.visible)) {
1649
+ clip.visibility = ikFrames.map((r) => ({ frame: r.frame, visible: r.visible }));
1650
+ }
1633
1651
  }
1634
1652
  this.animationState.loadAnimation(name, clip);
1635
1653
  });
@@ -1893,6 +1911,8 @@ export class Model {
1893
1911
  this.crossfade = null;
1894
1912
  this.oneShot = null;
1895
1913
  this.animationState.clear();
1914
+ // No clip, no motion to hide her: a cleared clip must not leave her gone.
1915
+ this.motionHidden = false;
1896
1916
  }
1897
1917
  // Seek by absolute timeline seconds, not frame index.
1898
1918
  seek(seconds) {
@@ -1939,6 +1959,7 @@ export class Model {
1939
1959
  /** Step the IK state to `frame`. VMD IK keys are steps: a state holds until
1940
1960
  * the next one changes it, so this is a lookup, not an interpolation. */
1941
1961
  applyIkFromClip(clip, frame) {
1962
+ this.applyVisibilityFromClip(clip, frame);
1942
1963
  if (!clip.ikTracks || clip.ikTracks.size === 0) {
1943
1964
  if (this.ikDisabled.size > 0)
1944
1965
  this.ikDisabled.clear();
@@ -1956,6 +1977,16 @@ export class Model {
1956
1977
  this.ikDisabled.add(index);
1957
1978
  }
1958
1979
  }
1980
+ /** Step the motion's display flag to `frame`. Before its first key she is
1981
+ * shown — MMD's own reading of a motion that starts hidden later. */
1982
+ applyVisibilityFromClip(clip, frame) {
1983
+ const keys = clip.visibility;
1984
+ let shown = true;
1985
+ if (keys)
1986
+ for (let i = 0; i < keys.length && keys[i].frame <= frame; i++)
1987
+ shown = keys[i].visible;
1988
+ this.motionHidden = !shown;
1989
+ }
1959
1990
  /** Sample one bone track at `frame` into outRot + outVmdTrans. The translation is
1960
1991
  * VMD-space (bind-relative), NOT yet converted to bone-local — callers convert with
1961
1992
  * convertVMDTranslationToLocal once they know the final rotation. The cursor cache
@@ -2429,6 +2460,8 @@ export class Model {
2429
2460
  }
2430
2461
  else {
2431
2462
  const clip = this.animationState.getCurrentClip();
2463
+ if (clip === null)
2464
+ this.motionHidden = false;
2432
2465
  if (clip !== null) {
2433
2466
  this.applyPoseFromClip(clip, this.animationState.getCurrentFrame());
2434
2467
  if (evWatch !== null && evWatch === this.animationState.getCurrentAnimation()) {
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/shaders/materials/common.ts"],"names":[],"mappings":"AA4BA;;;;uBAIuB;AACvB,eAAO,MAAM,iBAAiB,8iFA4D7B,CAAA;AAED;mEACmE;AACnE,eAAO,MAAM,wBAAwB,kIAC4F,CAAA;AAEjI,eAAO,MAAM,oBAAoB,QA6QhC,CAAC;AA4JF,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAGD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,orMAgHzB,CAAA;AAQD,eAAO,MAAM,4BAA4B,QAC6H,CAAA"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/shaders/materials/common.ts"],"names":[],"mappings":"AA4BA;;;;uBAIuB;AACvB,eAAO,MAAM,iBAAiB,8iFA4D7B,CAAA;AAED;mEACmE;AACnE,eAAO,MAAM,wBAAwB,kIAC4F,CAAA;AAEjI,eAAO,MAAM,oBAAoB,QAiQhC,CAAC;AA2JF,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAGD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,orMAgHzB,CAAA;AAQD,eAAO,MAAM,4BAA4B,QAC6H,CAAA"}
@@ -185,18 +185,6 @@ struct VertexOutput {
185
185
  // At rest skinMats are identity so restPos == worldPos, which is why existing noise-
186
186
  // scale constants stay valid without retuning.
187
187
  @location(3) restPos: vec3f,
188
- /**
189
- * This TRIANGLE's dissolve threshold.
190
- *
191
- * FLAT, so every fragment of a face shares the provoking vertex's value and
192
- * the face goes as a unit — the mesh comes apart in triangles that light and
193
- * leave in turn, rather than in a scatter that crosses them. Computed in the
194
- * vertex stage from the bind-pose attribute, which is what lets the depth
195
- * prepass, the shadow map and the outline hull reach the same number for the
196
- * same face: one function, one input, one provoking vertex, one answer. They
197
- * must agree — a pass that disagrees punches holes through her.
198
- */
199
- @location(4) @interpolate(flat) faceT: f32,
200
188
  /** The scene fog's two amounts, computed PER VERTEX as the game does — see
201
189
  * Engine.setSceneFog — and interpolated across the face. */
202
190
  @location(5) fog: vec2f,
@@ -474,7 +462,6 @@ const COMMON_VS_WGSL = /* wgsl */ `
474
462
  output.uv = uv;
475
463
  output.worldPos = skinnedPos.xyz;
476
464
  output.restPos = position;
477
- output.faceT = rz_dissolve_threshold(position);
478
465
  let viewZ = (camera.view * vec4f(skinnedPos.xyz, 1.0)).z;
479
466
  output.fog = vec2f(
480
467
  _rzFogAmount(viewZ, skinnedPos.y, light.fog[0], light.fog[1]),
@@ -1 +1 @@
1
- {"version":3,"file":"depth-prepass.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/depth-prepass.ts"],"names":[],"mappings":"AAgCA,wBAAgB,2BAA2B,IAAI,MAAM,CAkGpD"}
1
+ {"version":3,"file":"depth-prepass.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/depth-prepass.ts"],"names":[],"mappings":"AAgCA,wBAAgB,2BAA2B,IAAI,MAAM,CA8FpD"}
@@ -67,9 +67,6 @@ struct VSOut {
67
67
  // The bind-pose position, carried for one reason: the dissolve test below has
68
68
  // to be the SAME test the colour pass runs, and that one is in object space.
69
69
  @location(1) restPos: vec3f,
70
- /** The triangle's own threshold, flat — see the material VertexOutput. This
71
- * pass must throw away exactly the faces the colour pass does. */
72
- @location(2) @interpolate(flat) faceT: f32,
73
70
  };
74
71
 
75
72
  @vertex fn vs(
@@ -92,7 +89,6 @@ struct VSOut {
92
89
  o.position = camera.projection * camera.view * vec4f(skinned.xyz, 1.0);
93
90
  o.uv = uv;
94
91
  o.restPos = position;
95
- o.faceT = rz_dissolve_threshold(position);
96
92
  return o;
97
93
  }
98
94
 
@@ -119,7 +115,7 @@ override CUTOFF: f32 = 0.5;
119
115
  // the colour pass throws away would punch holes that occlude the floor behind
120
116
  // her: you would see sky through her, which is the failure this line exists
121
117
  // to prevent.
122
- if (material.dissolve < 0.9995 && in.faceT > material.dissolve) { discard; }
118
+ if (material.dissolve < 0.9995 && rz_dissolve_threshold(in.restPos) > material.dissolve) { discard; }
123
119
  var out: PrepassOut;
124
120
  out.color = vec4f(0.0);
125
121
  out.mask = vec4f(0.0);
@@ -1 +1 @@
1
- {"version":3,"file":"outline.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/outline.ts"],"names":[],"mappings":"AAqBA;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAA;AAC5C;yCACyC;AACzC,eAAO,MAAM,uBAAuB,KAAK,CAAA;AACzC;mEACmE;AACnE,eAAO,MAAM,uBAAuB,KAAK,CAAA;AACzC;;yCAEyC;AACzC,eAAO,MAAM,0BAA0B,KAAK,CAAA;AAC5C,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAC1C,uCAAuC;AACvC,eAAO,MAAM,yBAAyB,KAAK,CAAA;AAE3C,wBAAgB,iBAAiB,IAAI,MAAM,CA6P1C"}
1
+ {"version":3,"file":"outline.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/outline.ts"],"names":[],"mappings":"AAqBA;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAA;AAC5C;yCACyC;AACzC,eAAO,MAAM,uBAAuB,KAAK,CAAA;AACzC;mEACmE;AACnE,eAAO,MAAM,uBAAuB,KAAK,CAAA;AACzC;;yCAEyC;AACzC,eAAO,MAAM,0BAA0B,KAAK,CAAA;AAC5C,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAC1C,uCAAuC;AACvC,eAAO,MAAM,yBAAyB,KAAK,CAAA;AAE3C,wBAAgB,iBAAiB,IAAI,MAAM,CAyP1C"}
@@ -100,9 +100,6 @@ struct VertexOutput {
100
100
  * the depth prepass measure against, so all three agree about which flakes
101
101
  * are gone. */
102
102
  @location(1) restPos: vec3f,
103
- /** The triangle's own threshold, flat — see the material VertexOutput. The
104
- * hull traces the body's faces, so it has to lose the same ones. */
105
- @location(2) @interpolate(flat) faceT: f32,
106
103
  /** How much of a pixel-wide line this one really is (1 = all of it): a line
107
104
  * held at the minimum width fades by what it was short. */
108
105
  @location(3) coverage: f32,
@@ -242,7 +239,6 @@ fn safe_normal2(v: vec2f) -> vec2f {
242
239
  output.position = vec4f(clipPos.xy + ndc * w, clipPos.z, clipPos.w);
243
240
  output.uv = uv;
244
241
  output.restPos = position;
245
- output.faceT = rz_dissolve_threshold(position);
246
242
  return output;
247
243
  }
248
244
 
@@ -268,7 +264,7 @@ ${sceneFsOutWgsl({ name: "FSOut", aux: "mask" })}
268
264
  // The same test the colour pass and the depth prepass run, against the same
269
265
  // bind-pose position — three passes, one rule, or they disagree about which
270
266
  // pieces are still there.
271
- if (material.dissolve < 0.9995 && input.faceT > material.dissolve) { discard; }
267
+ if (material.dissolve < 0.9995 && rz_dissolve_threshold(input.restPos) > material.dissolve) { discard; }
272
268
  let tex = textureSample(diffuseTexture, edgeSampler, input.uv);
273
269
  let texA = tex.a;
274
270
  if (texA < 0.05) {
@@ -1,2 +1,2 @@
1
- export declare const SHADOW_DEPTH_SHADER_WGSL = "\n\n/** Clump size, in object-space units \u2014 MMD's are roughly centimetres.\n *\n * Raised from 0.42: at that size the pieces are near enough to speckle that a\n * departure reads as a fade rather than as a body coming apart, which is the\n * thing the clumping exists to avoid. Hand-sized pieces are visible ones. */\nconst RZ_DISSOLVE_GRAIN: f32 = 1.2;\n/** How much the clumps pull a fragment off its own grit value \u2014 the whole of\n * the LOOK, and none of the rate. See rz_dissolve_threshold. */\nconst RZ_DISSOLVE_CLUMP: f32 = 0.6;\n/** Grit cell, as a fraction of a clump. See rz_dissolve_threshold: this is what\n * keeps a material SMALLER than a clump from having one threshold for all of\n * it, and it has to be smaller than the SMALLEST material a model carries \u2014\n * an eye highlight, a button, a buckle \u2014 not merely small. Two and a half\n * millimetres on a normal model, which is under all of them. */\nconst RZ_DISSOLVE_GRIT: f32 = 0.021;\n/** How wide the glowing front is, in threshold units. Thin: the front is a\n * rim, and a wide one lights whole limbs at once. */\nconst RZ_DISSOLVE_EDGE: f32 = 0.11;\n/** What the front burns with. Emission, added after lighting and after the\n * graph \u2014 a colour that ramps or takes a shadow reads as paint, not as heat.\n * Above 1 on purpose: it is meant to reach the bloom pyramid. Blue-violet,\n * the same light the motes leaving her are drawn and lit with. */\nconst RZ_BURN_COLOR: vec3f = vec3f(0.45, 0.62, 2.40);\n\nfn rz_dissolve_hash(p: vec3f) -> f32 {\n // INTEGER, for exactly the reason _hash33 in nodes.ts is, and its comment\n // says it: above 24 bits an f32 loses the low ones. The float hash this\n // replaces multiplied three terms into the hundreds of millions and took\n // fract() of the product \u2014 which past 2^24 is not noise, it is a quantised\n // staircase, and wherever that staircase landed on zero the threshold was\n // zero. A surface whose threshold is zero never crosses it: it stays behind\n // while the rest of her leaves, and it sits inside the burning front the\n // whole time she is gone. Those were the white pieces that would not go.\n //\n // Floored first, unlike _hash33: vec3i() truncates toward zero, so -0.5 and\n // +0.5 are the same cell, and half this model is at negative x.\n var h = vec3u(vec3i(floor(p)) + vec3i(32768));\n h = h * vec3u(1664525u, 1013904223u, 2654435761u);\n h = (h.yzx ^ h) * vec3u(2246822519u, 3266489917u, 668265263u);\n h = h ^ (h >> vec3u(16u));\n return f32((h.x ^ h.y ^ h.z) & 16777215u) * (1.0 / 16777216.0);\n}\n\n/** Value noise over that hash \u2014 smooth within a flake, uncorrelated between. */\nfn rz_dissolve_field(p: vec3f) -> f32 {\n let i = floor(p);\n let f = fract(p);\n let u = f * f * (3.0 - 2.0 * f);\n let c000 = rz_dissolve_hash(i);\n let c100 = rz_dissolve_hash(i + vec3f(1.0, 0.0, 0.0));\n let c010 = rz_dissolve_hash(i + vec3f(0.0, 1.0, 0.0));\n let c110 = rz_dissolve_hash(i + vec3f(1.0, 1.0, 0.0));\n let c001 = rz_dissolve_hash(i + vec3f(0.0, 0.0, 1.0));\n let c101 = rz_dissolve_hash(i + vec3f(1.0, 0.0, 1.0));\n let c011 = rz_dissolve_hash(i + vec3f(0.0, 1.0, 1.0));\n let c111 = rz_dissolve_hash(i + vec3f(1.0, 1.0, 1.0));\n let x00 = mix(c000, c100, u.x);\n let x10 = mix(c010, c110, u.x);\n let x01 = mix(c001, c101, u.x);\n let x11 = mix(c011, c111, u.x);\n return mix(mix(x00, x10, u.y), mix(x01, x11, u.y), u.z);\n}\n\n/**\n * The threshold this fragment is measured against.\n *\n * NOISE ALONE, so the whole body comes apart at once \u2014 a hand, a shoulder and\n * an ankle all thinning together rather than a line travelling up her. It was\n * tilted by height at first, on the argument that a sweep reads as something\n * happening TO her; what it actually reads as is a wipe, and a wipe has a\n * direction, an edge and a speed the rest of the effect knows nothing about.\n * Everywhere at once is also the honest match for what leaves: the motes are\n * shed from every limb in the same breath.\n *\n * TWO SCALES. Clumps alone meant every fragment of a material SMALLER than one\n * cell shared a single threshold: an eye highlight, a brow, a button, a hair\n * clip. All of it sat inside the glowing front at once, so the piece flashed\n * white as a whole and then popped \u2014 the two things a disintegration must never\n * do. The grit is a per-cell hash at a fraction of the clump, so a part a few\n * millimetres across still comes apart in pieces.\n *\n * THE GRIT IS THE BASE, though, and the clumps only push a fragment off it.\n * That ordering is what makes the dissolve smooth, and it is not obvious: the\n * two used to be WEIGHTED AND ADDED, and a sum is not uniformly distributed\n * however uniform each half is. It piles up in the middle, so most of the\n * surface had a threshold near a half \u2014 all of it went as the dissolve swept\n * through the middle, and what remained was the thin tail near zero. That tail\n * was the second stage everyone could see: a body that mostly vanished, then a\n * scatter of glowing scraps, then nothing.\n *\n * WRAPPED, not added. Offsetting a uniform value and taking fract() leaves it\n * EXACTLY uniform, where scaling a sum back into range only flattens the middle\n * \u2014 measured over four hundred thousand samples, the sum removed 12% of her per\n * step at the halfway mark and 0.1% at each end (a 110x swing), the scaled sum\n * still swung 89x, and the wrap is flat: 5.0% per step from the first flake to\n * the last, a ratio of 1.0.\n *\n * That flatness IS the smoothness. An uneven rate is what produced the two\n * stages you could see \u2014 a body that mostly vanished at once, then a scatter of\n * scraps that took as long again to follow.\n *\n * The clumping survives the wrap: neighbouring fragments share a clump value,\n * so the offset moves them together. What wraps past 1 comes back at 0 and goes\n * at the other end instead, which costs a little speckle in a region and buys\n * an even rate everywhere.\n */\nfn rz_dissolve_threshold(restPos: vec3f) -> f32 {\n let grit = rz_dissolve_hash(floor(restPos / (RZ_DISSOLVE_GRAIN * RZ_DISSOLVE_GRIT)));\n let clump = rz_dissolve_field(restPos / RZ_DISSOLVE_GRAIN) - 0.5;\n return fract(grit + clump * RZ_DISSOLVE_CLUMP);\n}\n\nstruct LightVP { viewProj: mat4x4f, };\n@group(0) @binding(0) var<uniform> lp: LightVP;\n@group(0) @binding(1) var<storage, read> skinMats: array<mat4x4f>;\n@group(0) @binding(2) var texSampler: sampler;\n@group(1) @binding(0) var diffuseTexture: texture_2d<f32>;\n// The head of the material block and the one field at its tail \u2014 the same\n// reach the depth prepass takes, and for the same reason: a shadow cast by a\n// body that is no longer drawn is the tell that the vanishing is a trick.\nstruct MaterialDiffuse {\n diffuse: vec4f,\n _skip0: vec4f,\n _skip1: vec4f,\n _skip2: f32,\n materialId: f32,\n _skip3: f32,\n dissolve: f32,\n};\n@group(1) @binding(1) var<uniform> material: MaterialDiffuse;\n// The model's ObjectLight, for its jelly eyes: the map must hold the iris where\n// the colour pass draws it.\nstruct ObjectLight { layers: vec4u, ambient: vec4f, sh: array<vec4f, 9>, fill: vec4f, jelly: array<vec4f, 12>, bloom: vec4f }\n@group(0) @binding(3) var<uniform> objectLight: ObjectLight;\n\nfn _rzJellyTurn(q: vec2f, a: f32) -> vec2f {\n let c = cos(a);\n let s = sin(a);\n return vec2f(c * q.x - s * q.y, s * q.x + c * q.y);\n}\n\n/**\n * Where the jelly puts an iris vertex. The iris is the part of the eye the eye\n * bones carry, so it is moved as a whole, in bind space before skinning:\n * scaled about its centre (the CPU composes the blink's spring, the lid's\n * press and her motion's knock into one scale), turned and drifted a hair on\n * the spring, brought forward a hair, and rolled about the eye bone with a\n * closing expression \u2014 inside the white, which stays where it is. A highlight\n * layer (this draw's material is one of jelly[1].w's) takes the iris's move,\n * then its own scale, turn and tremble, before the roll. Vertices take it by their weight on the eye bones\n * (jelly[2].w, jelly[3].w), so nothing else on the face moves.\n */\nfn rzJellyVertex(p: vec3f, joints: vec4<u32>, nw: vec4f) -> vec3f {\n let j = objectLight.jelly;\n let ids = u32(j[1].w);\n let mid = u32(material.materialId);\n let hl = mid > 0u && (mid == (ids & 4095u) || mid == (ids >> 12u));\n var out = p;\n for (var e = 0u; e < 2u; e++) {\n let bone = j[2u + e].w;\n if (bone < 0.0) { continue; }\n let b = u32(bone);\n let w = dot(nw, select(vec4f(0.0), vec4f(1.0), joints == vec4<u32>(b)));\n if (w <= 0.0) { continue; }\n let c = j[e].xyz;\n // A rig that carries both eyes on one bone: each vertex follows its own side.\n if (j[2].w == j[3].w && e == 0u && distance(p.xy, j[1].xy) < distance(p.xy, j[0].xy)) { continue; }\n if (j[2].w == j[3].w && e == 1u && distance(p.xy, j[0].xy) <= distance(p.xy, j[1].xy)) { continue; }\n let t = j[4u + e];\n let m = j[6u + e];\n let h = j[10u + e];\n var q = _rzJellyTurn((p.xy - c.xy) * t.xy, t.z) + m.xy;\n // Forward is \u2212Z (MMD faces \u2212Z).\n var push = h.z;\n if (hl) {\n // Sliding over the iris's dome on its own, a highlight sheet a hair in\n // front of it would sink into it where the dome bulges more and the two\n // fight for depth; so it comes forward by as far as it slid \u2014 a slope of\n // one, steeper than the dome anywhere it draws.\n let before = q;\n q = _rzJellyTurn(q * h.xy, t.w) + m.zw;\n push += length(q - before);\n }\n var moved = vec3f(c.xy + q, p.z - push);\n let roll = j[8u + e];\n if (roll.w != 0.0) {\n let d = moved - roll.xyz;\n let rd = _rzJellyTurn(d.yz, roll.w);\n moved = roll.xyz + vec3f(d.x, rd.x, rd.y);\n }\n out = mix(p, moved, w);\n }\n return out;\n}\n\n\nstruct VSOut {\n @builtin(position) position: vec4f,\n @location(0) uv: vec2f,\n /** Bind-pose position, for the dissolve test \u2014 object space, as everywhere. */\n @location(1) restPos: vec3f,\n /** The triangle's own threshold, flat \u2014 see the material VertexOutput. A\n * face that is gone must stop casting, and stop as a whole face. */\n @location(2) @interpolate(flat) faceT: f32,\n};\n\n@vertex fn vs(@location(0) position: vec3f, @location(1) normal: vec3f, @location(2) uv: vec2f,\n @location(3) joints0: vec4<u32>, @location(4) weights0: vec4<f32>) -> VSOut {\n let ws = weights0.x + weights0.y + weights0.z + weights0.w;\n let inv = select(1.0, 1.0 / ws, ws > 0.0001);\n let nw = select(vec4f(1.0,0.0,0.0,0.0), weights0 * inv, ws > 0.0001);\n var pos4 = vec4f(position, 1.0);\n if (objectLight.jelly[0].w > 0.0) { pos4 = vec4f(rzJellyVertex(position, joints0, nw), 1.0); }\n var sp = vec4f(0.0);\n for (var i = 0u; i < 4u; i++) { sp += (skinMats[joints0[i]] * pos4) * nw[i]; }\n var out: VSOut;\n out.position = lp.viewProj * vec4f(sp.xyz, 1.0);\n out.uv = uv;\n out.restPos = position;\n out.faceT = rz_dissolve_threshold(position);\n return out;\n}\n\n@fragment fn fs(in: VSOut) {\n let alpha = textureSample(diffuseTexture, texSampler, in.uv).a * material.diffuse.a;\n if (alpha < 0.5) { discard; }\n // The dissolve, run as the colour pass runs it. A flake that is gone stops\n // casting: without this she leaves a whole shadow standing on the floor while\n // her body is in the air.\n if (material.dissolve < 0.9995 && in.faceT > material.dissolve) { discard; }\n}\n";
1
+ export declare const SHADOW_DEPTH_SHADER_WGSL = "\n\n/** Clump size, in object-space units \u2014 MMD's are roughly centimetres.\n *\n * Raised from 0.42: at that size the pieces are near enough to speckle that a\n * departure reads as a fade rather than as a body coming apart, which is the\n * thing the clumping exists to avoid. Hand-sized pieces are visible ones. */\nconst RZ_DISSOLVE_GRAIN: f32 = 1.2;\n/** How much the clumps pull a fragment off its own grit value \u2014 the whole of\n * the LOOK, and none of the rate. See rz_dissolve_threshold. */\nconst RZ_DISSOLVE_CLUMP: f32 = 0.6;\n/** Grit cell, as a fraction of a clump. See rz_dissolve_threshold: this is what\n * keeps a material SMALLER than a clump from having one threshold for all of\n * it, and it has to be smaller than the SMALLEST material a model carries \u2014\n * an eye highlight, a button, a buckle \u2014 not merely small. Two and a half\n * millimetres on a normal model, which is under all of them. */\nconst RZ_DISSOLVE_GRIT: f32 = 0.021;\n/** How wide the glowing front is, in threshold units. Thin: the front is a\n * rim, and a wide one lights whole limbs at once. */\nconst RZ_DISSOLVE_EDGE: f32 = 0.11;\n/** What the front burns with. Emission, added after lighting and after the\n * graph \u2014 a colour that ramps or takes a shadow reads as paint, not as heat.\n * Above 1 on purpose: it is meant to reach the bloom pyramid. Blue-violet,\n * the same light the motes leaving her are drawn and lit with. */\nconst RZ_BURN_COLOR: vec3f = vec3f(0.45, 0.62, 2.40);\n\nfn rz_dissolve_hash(p: vec3f) -> f32 {\n // INTEGER, for exactly the reason _hash33 in nodes.ts is, and its comment\n // says it: above 24 bits an f32 loses the low ones. The float hash this\n // replaces multiplied three terms into the hundreds of millions and took\n // fract() of the product \u2014 which past 2^24 is not noise, it is a quantised\n // staircase, and wherever that staircase landed on zero the threshold was\n // zero. A surface whose threshold is zero never crosses it: it stays behind\n // while the rest of her leaves, and it sits inside the burning front the\n // whole time she is gone. Those were the white pieces that would not go.\n //\n // Floored first, unlike _hash33: vec3i() truncates toward zero, so -0.5 and\n // +0.5 are the same cell, and half this model is at negative x.\n var h = vec3u(vec3i(floor(p)) + vec3i(32768));\n h = h * vec3u(1664525u, 1013904223u, 2654435761u);\n h = (h.yzx ^ h) * vec3u(2246822519u, 3266489917u, 668265263u);\n h = h ^ (h >> vec3u(16u));\n return f32((h.x ^ h.y ^ h.z) & 16777215u) * (1.0 / 16777216.0);\n}\n\n/** Value noise over that hash \u2014 smooth within a flake, uncorrelated between. */\nfn rz_dissolve_field(p: vec3f) -> f32 {\n let i = floor(p);\n let f = fract(p);\n let u = f * f * (3.0 - 2.0 * f);\n let c000 = rz_dissolve_hash(i);\n let c100 = rz_dissolve_hash(i + vec3f(1.0, 0.0, 0.0));\n let c010 = rz_dissolve_hash(i + vec3f(0.0, 1.0, 0.0));\n let c110 = rz_dissolve_hash(i + vec3f(1.0, 1.0, 0.0));\n let c001 = rz_dissolve_hash(i + vec3f(0.0, 0.0, 1.0));\n let c101 = rz_dissolve_hash(i + vec3f(1.0, 0.0, 1.0));\n let c011 = rz_dissolve_hash(i + vec3f(0.0, 1.0, 1.0));\n let c111 = rz_dissolve_hash(i + vec3f(1.0, 1.0, 1.0));\n let x00 = mix(c000, c100, u.x);\n let x10 = mix(c010, c110, u.x);\n let x01 = mix(c001, c101, u.x);\n let x11 = mix(c011, c111, u.x);\n return mix(mix(x00, x10, u.y), mix(x01, x11, u.y), u.z);\n}\n\n/**\n * The threshold this fragment is measured against.\n *\n * NOISE ALONE, so the whole body comes apart at once \u2014 a hand, a shoulder and\n * an ankle all thinning together rather than a line travelling up her. It was\n * tilted by height at first, on the argument that a sweep reads as something\n * happening TO her; what it actually reads as is a wipe, and a wipe has a\n * direction, an edge and a speed the rest of the effect knows nothing about.\n * Everywhere at once is also the honest match for what leaves: the motes are\n * shed from every limb in the same breath.\n *\n * TWO SCALES. Clumps alone meant every fragment of a material SMALLER than one\n * cell shared a single threshold: an eye highlight, a brow, a button, a hair\n * clip. All of it sat inside the glowing front at once, so the piece flashed\n * white as a whole and then popped \u2014 the two things a disintegration must never\n * do. The grit is a per-cell hash at a fraction of the clump, so a part a few\n * millimetres across still comes apart in pieces.\n *\n * THE GRIT IS THE BASE, though, and the clumps only push a fragment off it.\n * That ordering is what makes the dissolve smooth, and it is not obvious: the\n * two used to be WEIGHTED AND ADDED, and a sum is not uniformly distributed\n * however uniform each half is. It piles up in the middle, so most of the\n * surface had a threshold near a half \u2014 all of it went as the dissolve swept\n * through the middle, and what remained was the thin tail near zero. That tail\n * was the second stage everyone could see: a body that mostly vanished, then a\n * scatter of glowing scraps, then nothing.\n *\n * WRAPPED, not added. Offsetting a uniform value and taking fract() leaves it\n * EXACTLY uniform, where scaling a sum back into range only flattens the middle\n * \u2014 measured over four hundred thousand samples, the sum removed 12% of her per\n * step at the halfway mark and 0.1% at each end (a 110x swing), the scaled sum\n * still swung 89x, and the wrap is flat: 5.0% per step from the first flake to\n * the last, a ratio of 1.0.\n *\n * That flatness IS the smoothness. An uneven rate is what produced the two\n * stages you could see \u2014 a body that mostly vanished at once, then a scatter of\n * scraps that took as long again to follow.\n *\n * The clumping survives the wrap: neighbouring fragments share a clump value,\n * so the offset moves them together. What wraps past 1 comes back at 0 and goes\n * at the other end instead, which costs a little speckle in a region and buys\n * an even rate everywhere.\n */\nfn rz_dissolve_threshold(restPos: vec3f) -> f32 {\n let grit = rz_dissolve_hash(floor(restPos / (RZ_DISSOLVE_GRAIN * RZ_DISSOLVE_GRIT)));\n let clump = rz_dissolve_field(restPos / RZ_DISSOLVE_GRAIN) - 0.5;\n return fract(grit + clump * RZ_DISSOLVE_CLUMP);\n}\n\nstruct LightVP { viewProj: mat4x4f, };\n@group(0) @binding(0) var<uniform> lp: LightVP;\n@group(0) @binding(1) var<storage, read> skinMats: array<mat4x4f>;\n@group(0) @binding(2) var texSampler: sampler;\n@group(1) @binding(0) var diffuseTexture: texture_2d<f32>;\n// The head of the material block and the one field at its tail \u2014 the same\n// reach the depth prepass takes, and for the same reason: a shadow cast by a\n// body that is no longer drawn is the tell that the vanishing is a trick.\nstruct MaterialDiffuse {\n diffuse: vec4f,\n _skip0: vec4f,\n _skip1: vec4f,\n _skip2: f32,\n materialId: f32,\n _skip3: f32,\n dissolve: f32,\n};\n@group(1) @binding(1) var<uniform> material: MaterialDiffuse;\n// The model's ObjectLight, for its jelly eyes: the map must hold the iris where\n// the colour pass draws it.\nstruct ObjectLight { layers: vec4u, ambient: vec4f, sh: array<vec4f, 9>, fill: vec4f, jelly: array<vec4f, 12>, bloom: vec4f }\n@group(0) @binding(3) var<uniform> objectLight: ObjectLight;\n\nfn _rzJellyTurn(q: vec2f, a: f32) -> vec2f {\n let c = cos(a);\n let s = sin(a);\n return vec2f(c * q.x - s * q.y, s * q.x + c * q.y);\n}\n\n/**\n * Where the jelly puts an iris vertex. The iris is the part of the eye the eye\n * bones carry, so it is moved as a whole, in bind space before skinning:\n * scaled about its centre (the CPU composes the blink's spring, the lid's\n * press and her motion's knock into one scale), turned and drifted a hair on\n * the spring, brought forward a hair, and rolled about the eye bone with a\n * closing expression \u2014 inside the white, which stays where it is. A highlight\n * layer (this draw's material is one of jelly[1].w's) takes the iris's move,\n * then its own scale, turn and tremble, before the roll. Vertices take it by their weight on the eye bones\n * (jelly[2].w, jelly[3].w), so nothing else on the face moves.\n */\nfn rzJellyVertex(p: vec3f, joints: vec4<u32>, nw: vec4f) -> vec3f {\n let j = objectLight.jelly;\n let ids = u32(j[1].w);\n let mid = u32(material.materialId);\n let hl = mid > 0u && (mid == (ids & 4095u) || mid == (ids >> 12u));\n var out = p;\n for (var e = 0u; e < 2u; e++) {\n let bone = j[2u + e].w;\n if (bone < 0.0) { continue; }\n let b = u32(bone);\n let w = dot(nw, select(vec4f(0.0), vec4f(1.0), joints == vec4<u32>(b)));\n if (w <= 0.0) { continue; }\n let c = j[e].xyz;\n // A rig that carries both eyes on one bone: each vertex follows its own side.\n if (j[2].w == j[3].w && e == 0u && distance(p.xy, j[1].xy) < distance(p.xy, j[0].xy)) { continue; }\n if (j[2].w == j[3].w && e == 1u && distance(p.xy, j[0].xy) <= distance(p.xy, j[1].xy)) { continue; }\n let t = j[4u + e];\n let m = j[6u + e];\n let h = j[10u + e];\n var q = _rzJellyTurn((p.xy - c.xy) * t.xy, t.z) + m.xy;\n // Forward is \u2212Z (MMD faces \u2212Z).\n var push = h.z;\n if (hl) {\n // Sliding over the iris's dome on its own, a highlight sheet a hair in\n // front of it would sink into it where the dome bulges more and the two\n // fight for depth; so it comes forward by as far as it slid \u2014 a slope of\n // one, steeper than the dome anywhere it draws.\n let before = q;\n q = _rzJellyTurn(q * h.xy, t.w) + m.zw;\n push += length(q - before);\n }\n var moved = vec3f(c.xy + q, p.z - push);\n let roll = j[8u + e];\n if (roll.w != 0.0) {\n let d = moved - roll.xyz;\n let rd = _rzJellyTurn(d.yz, roll.w);\n moved = roll.xyz + vec3f(d.x, rd.x, rd.y);\n }\n out = mix(p, moved, w);\n }\n return out;\n}\n\n\nstruct VSOut {\n @builtin(position) position: vec4f,\n @location(0) uv: vec2f,\n /** Bind-pose position, for the dissolve test \u2014 object space, as everywhere.\n * A flake that is gone must stop casting. */\n @location(1) restPos: vec3f,\n};\n\n@vertex fn vs(@location(0) position: vec3f, @location(1) normal: vec3f, @location(2) uv: vec2f,\n @location(3) joints0: vec4<u32>, @location(4) weights0: vec4<f32>) -> VSOut {\n let ws = weights0.x + weights0.y + weights0.z + weights0.w;\n let inv = select(1.0, 1.0 / ws, ws > 0.0001);\n let nw = select(vec4f(1.0,0.0,0.0,0.0), weights0 * inv, ws > 0.0001);\n var pos4 = vec4f(position, 1.0);\n if (objectLight.jelly[0].w > 0.0) { pos4 = vec4f(rzJellyVertex(position, joints0, nw), 1.0); }\n var sp = vec4f(0.0);\n for (var i = 0u; i < 4u; i++) { sp += (skinMats[joints0[i]] * pos4) * nw[i]; }\n var out: VSOut;\n out.position = lp.viewProj * vec4f(sp.xyz, 1.0);\n out.uv = uv;\n out.restPos = position;\n return out;\n}\n\n@fragment fn fs(in: VSOut) {\n let alpha = textureSample(diffuseTexture, texSampler, in.uv).a * material.diffuse.a;\n if (alpha < 0.5) { discard; }\n // The dissolve, run as the colour pass runs it. A flake that is gone stops\n // casting: without this she leaves a whole shadow standing on the floor while\n // her body is in the air.\n if (material.dissolve < 0.9995 && rz_dissolve_threshold(in.restPos) > material.dissolve) { discard; }\n}\n";
2
2
  //# sourceMappingURL=shadow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/shadow.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,wBAAwB,qzWA6DpC,CAAA"}
1
+ {"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/shadow.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,wBAAwB,moWA0DpC,CAAA"}
@@ -34,11 +34,9 @@ ${JELLY_VERTEX_WGSL}
34
34
  struct VSOut {
35
35
  @builtin(position) position: vec4f,
36
36
  @location(0) uv: vec2f,
37
- /** Bind-pose position, for the dissolve test — object space, as everywhere. */
37
+ /** Bind-pose position, for the dissolve test — object space, as everywhere.
38
+ * A flake that is gone must stop casting. */
38
39
  @location(1) restPos: vec3f,
39
- /** The triangle's own threshold, flat — see the material VertexOutput. A
40
- * face that is gone must stop casting, and stop as a whole face. */
41
- @location(2) @interpolate(flat) faceT: f32,
42
40
  };
43
41
 
44
42
  @vertex fn vs(@location(0) position: vec3f, @location(1) normal: vec3f, @location(2) uv: vec2f,
@@ -54,7 +52,6 @@ struct VSOut {
54
52
  out.position = lp.viewProj * vec4f(sp.xyz, 1.0);
55
53
  out.uv = uv;
56
54
  out.restPos = position;
57
- out.faceT = rz_dissolve_threshold(position);
58
55
  return out;
59
56
  }
60
57
 
@@ -64,6 +61,6 @@ struct VSOut {
64
61
  // The dissolve, run as the colour pass runs it. A flake that is gone stops
65
62
  // casting: without this she leaves a whole shadow standing on the floor while
66
63
  // her body is in the air.
67
- if (material.dissolve < 0.9995 && in.faceT > material.dissolve) { discard; }
64
+ if (material.dissolve < 0.9995 && rz_dissolve_threshold(in.restPos) > material.dissolve) { discard; }
68
65
  }
69
66
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"vmd-writer.d.ts","sourceRoot":"","sources":["../src/vmd-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAmC,MAAM,aAAa,CAAA;AAC5E,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,cAAc,CAAA;AAsDhF;;;;;;;;8CAQ8C;AAC9C,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE3D,qBAAa,SAAS;IACpB,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;KAAE,GAAG,WAAW;IA0IjF;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,WAAW;CAiDnD"}
1
+ {"version":3,"file":"vmd-writer.d.ts","sourceRoot":"","sources":["../src/vmd-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAmC,MAAM,aAAa,CAAA;AAC5E,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,cAAc,CAAA;AAsDhF;;;;;;;;8CAQ8C;AAC9C,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE3D,qBAAa,SAAS;IACpB,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;KAAE,GAAG,WAAW;IAqJjF;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,WAAW;CAiDnD"}
@@ -82,6 +82,22 @@ export class VMDWriter {
82
82
  ikByFrame.set(key.frame, [{ boneName, enabled: key.enabled }]);
83
83
  }
84
84
  }
85
+ // The model's display flag rides in the same records. A moment it changes
86
+ // with no IK switch beside it still needs a record of its own, and every
87
+ // record states the flag as it stands then — one written as "shown" would
88
+ // bring her back mid-hide on the way in.
89
+ const visibility = wantBones ? clip.visibility : undefined;
90
+ if (visibility)
91
+ for (const key of visibility)
92
+ if (!ikByFrame.has(key.frame))
93
+ ikByFrame.set(key.frame, []);
94
+ const shownAt = (frame) => {
95
+ let shown = true;
96
+ if (visibility)
97
+ for (let i = 0; i < visibility.length && visibility[i].frame <= frame; i++)
98
+ shown = visibility[i].visible;
99
+ return shown;
100
+ };
85
101
  const ikFrames = [...ikByFrame.entries()].sort((a, b) => a[0] - b[0]);
86
102
  let ikSize = 0;
87
103
  for (const [, states] of ikFrames)
@@ -168,7 +184,7 @@ export class VMDWriter {
168
184
  for (const [frame, states] of ikFrames) {
169
185
  view.setUint32(offset, frame, true);
170
186
  offset += 4;
171
- view.setUint8(offset, 1); // model visible
187
+ view.setUint8(offset, shownAt(frame) ? 1 : 0); // model visible
172
188
  offset += 1;
173
189
  view.setUint32(offset, states.length, true);
174
190
  offset += 4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reze-engine",
3
- "version": "0.68.28",
3
+ "version": "0.68.31",
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",
package/src/animation.ts CHANGED
@@ -39,9 +39,19 @@ export interface AnimationClip {
39
39
  /** Per-chain IK state over time. Absent means "leave IK as the host set it" —
40
40
  * which is what every clip built before this existed will do. */
41
41
  ikTracks?: Map<string, IkKeyframe[]>
42
+ /** When the motion shows and hides the model — the 表示 flag of VMD's
43
+ * IK/display block, which motions use to make a character vanish for a
44
+ * stretch. Steps, like IK. Absent means the motion never hides her. */
45
+ visibility?: VisibilityKeyframe[]
42
46
  frameCount: number // last keyframe frame index
43
47
  }
44
48
 
49
+ /** One moment a motion shows or hides its model. Holds until the next one. */
50
+ export interface VisibilityKeyframe {
51
+ frame: number
52
+ visible: boolean
53
+ }
54
+
45
55
  export interface AnimationPlayOptions {
46
56
  priority?: number // Higher number = higher priority. Default: 0.
47
57
  loop?: boolean // When true, timeline wraps at end. Default: false.
@@ -114,6 +124,7 @@ export class AnimationState {
114
124
  boneTracks: clip.boneTracks,
115
125
  morphTracks: clip.morphTracks,
116
126
  ikTracks: clip.ikTracks,
127
+ visibility: clip.visibility,
117
128
  frameCount: clip.frameCount,
118
129
  })
119
130
  }
@@ -139,6 +150,7 @@ export class AnimationState {
139
150
  boneTracks: clip?.boneTracks ?? new Map(),
140
151
  morphTracks,
141
152
  ikTracks: clip?.ikTracks,
153
+ visibility: clip?.visibility,
142
154
  frameCount: Math.max(clip?.frameCount ?? 0, frameCount),
143
155
  })
144
156
  }
package/src/engine.ts CHANGED
@@ -4964,7 +4964,7 @@ export class Engine {
4964
4964
  private writeCastSeedProps(): void {
4965
4965
  let n = 0
4966
4966
  this.forEachInstance((inst) => {
4967
- if (inst.isProp && inst.model.visible) n++
4967
+ if (inst.isProp && inst.model.drawn) n++
4968
4968
  })
4969
4969
  let data = this.castSeedPropData
4970
4970
  let changed = data[0] !== n
@@ -4985,7 +4985,7 @@ export class Engine {
4985
4985
  data[0] = n
4986
4986
  let i = 1
4987
4987
  this.forEachInstance((inst) => {
4988
- if (!inst.isProp || !inst.model.visible) return
4988
+ if (!inst.isProp || !inst.model.drawn) return
4989
4989
  if (data[i] !== inst.objectId) changed = true
4990
4990
  data[i++] = inst.objectId
4991
4991
  })
@@ -6761,7 +6761,7 @@ export class Engine {
6761
6761
  let n = 0
6762
6762
  for (const inst of this.modelInstances.values()) {
6763
6763
  const m = inst.model
6764
- if (!m.visible) continue
6764
+ if (!m.drawn) continue
6765
6765
  let byPrefix = this.pointBones.get(m)
6766
6766
  if (!byPrefix) this.pointBones.set(m, (byPrefix = new Map()))
6767
6767
  let bones = byPrefix.get(points.prefix)
@@ -7720,7 +7720,7 @@ export class Engine {
7720
7720
  for (const inst of this.modelInstances.values()) {
7721
7721
  // Neither a stage nor a plane is a performer, so neither is a subject an
7722
7722
  // effect can follow.
7723
- if (!inst.model.visible || inst.isStage || inst.isPlane || inst.isProp) continue
7723
+ if (!inst.model.drawn || inst.isStage || inst.isPlane || inst.isProp) continue
7724
7724
  const model = inst.model
7725
7725
  const matrices = model.getWorldMatrices()
7726
7726
  if (matrices.length === 0) continue
@@ -11177,7 +11177,7 @@ export class Engine {
11177
11177
  const p = new Vec3(0, 0, 0)
11178
11178
  let any = false
11179
11179
  for (const inst of this.modelInstances.values()) {
11180
- if (!inst.isStage || !inst.model.visible) continue
11180
+ if (!inst.isStage || !inst.model.drawn) continue
11181
11181
  const m = inst.model
11182
11182
  for (const draw of inst.drawCalls) {
11183
11183
  const b = draw.bounds
@@ -11417,12 +11417,12 @@ export class Engine {
11417
11417
  })
11418
11418
  pass.setStencilReference(Engine.STENCIL_EYE_VALUE)
11419
11419
  for (const inst of this.modelInstances.values()) {
11420
- if (!inst.isStage || !inst.model.visible) continue
11420
+ if (!inst.isStage || !inst.model.drawn) continue
11421
11421
  this.setModelDrawState(pass, inst)
11422
11422
  this.drawMaterials(pass, inst, "opaque", view)
11423
11423
  }
11424
11424
  for (const inst of this.modelInstances.values()) {
11425
- if (!inst.isStage || !inst.model.visible) continue
11425
+ if (!inst.isStage || !inst.model.drawn) continue
11426
11426
  this.setModelDrawState(pass, inst)
11427
11427
  this.drawMaterials(pass, inst, "transparent", view)
11428
11428
  }
@@ -11773,7 +11773,7 @@ export class Engine {
11773
11773
  if (opts && stage) {
11774
11774
  let minX = Infinity, minY = Infinity, minZ = Infinity, maxX = -Infinity, maxY = -Infinity, maxZ = -Infinity
11775
11775
  for (const inst of this.modelInstances.values()) {
11776
- if (inst.isStage || inst.isPlane || inst.isProp || !inst.model.visible) continue
11776
+ if (inst.isStage || inst.isPlane || inst.isProp || !inst.model.drawn) continue
11777
11777
  const s = this.castSphereScratch
11778
11778
  this.writeCullSphere(inst, s, 0)
11779
11779
  if (!(s[3] < 1e6)) continue
@@ -14105,6 +14105,7 @@ export class Engine {
14105
14105
  if (inst.jellyEyes) {
14106
14106
  inst.jellyEyes.strength = clampStrength(options.strength)
14107
14107
  inst.jellyEyes.idle = options.idle ?? true
14108
+ inst.jellyEyes.motion = options.motion ?? true
14108
14109
  }
14109
14110
  else inst.jellyEyes = new JellyEyes(inst.model, options)
14110
14111
  return true
@@ -14112,7 +14113,7 @@ export class Engine {
14112
14113
 
14113
14114
  getModelJellyEyes(modelName: string): Required<JellyEyeOptions> | null {
14114
14115
  const jelly = this.modelInstances.get(modelName)?.jellyEyes
14115
- return jelly ? { strength: jelly.strength, idle: jelly.idle } : null
14116
+ return jelly ? { strength: jelly.strength, idle: jelly.idle, motion: jelly.motion } : null
14116
14117
  }
14117
14118
 
14118
14119
  getModelCastShadow(modelName: string): boolean {
@@ -14583,7 +14584,7 @@ export class Engine {
14583
14584
  for (let i = 0; i < this.cullModels.length; i++) {
14584
14585
  const inst = this.cullModels[i]
14585
14586
  const o = i * Engine.CULL_MODEL_FLOATS
14586
- let f = inst.model.visible ? Engine.CULL_MODEL_VISIBLE : 0
14587
+ let f = inst.model.drawn ? Engine.CULL_MODEL_VISIBLE : 0
14587
14588
  if (inst.rigid) {
14588
14589
  data.set(inst.rigidXform, o)
14589
14590
  f |= Engine.CULL_MODEL_RIGID
@@ -14702,7 +14703,7 @@ export class Engine {
14702
14703
  out.fill(0)
14703
14704
  for (let i = 0; i < this.cullModels.length; i++) {
14704
14705
  const inst = this.cullModels[i]
14705
- if (!inst.model.visible || inst.shadowDrawCalls.length === 0) continue
14706
+ if (!inst.model.drawn || inst.shadowDrawCalls.length === 0) continue
14706
14707
  if (inst.rigid) {
14707
14708
  // No sphere to read. Bail out of the whole optimisation.
14708
14709
  out[3] = -1
@@ -14722,7 +14723,7 @@ export class Engine {
14722
14723
  heads.fill(0)
14723
14724
  for (let i = 0; i < this.cullModels.length; i++) {
14724
14725
  const inst = this.cullModels[i]
14725
- if (!inst.model.visible || inst.rigid || inst.isStage || inst.isPlane || inst.isProp || inst.shadowDrawCalls.length === 0) continue
14726
+ if (!inst.model.drawn || inst.rigid || inst.isStage || inst.isPlane || inst.isProp || inst.shadowDrawCalls.length === 0) continue
14726
14727
  const o = i * Engine.CULL_MODEL_FLOATS + 16
14727
14728
  growSphere(out, data[o], data[o + 1], data[o + 2], data[o + 3])
14728
14729
  const m = inst.model
@@ -15293,7 +15294,7 @@ export class Engine {
15293
15294
  report.models.push({
15294
15295
  name: inst.name,
15295
15296
  rigid: inst.rigid,
15296
- visible: inst.model.visible,
15297
+ visible: inst.model.drawn,
15297
15298
  draws: inst.drawCalls.length,
15298
15299
  cameraVisible: 0,
15299
15300
  shadowVisible: 0,
@@ -17685,7 +17686,7 @@ export class Engine {
17685
17686
  pass.setBindGroup(0, this.pickPerFrameBindGroup)
17686
17687
 
17687
17688
  this.forEachInstance((inst) => {
17688
- if (!inst.model.visible) return // hidden models aren't pickable
17689
+ if (!inst.model.drawn) return // hidden models aren't pickable
17689
17690
  pass.setVertexBuffer(0, inst.vertexBuffer)
17690
17691
  pass.setVertexBuffer(1, inst.jointsBuffer)
17691
17692
  pass.setVertexBuffer(2, inst.weightsBuffer)
@@ -18583,7 +18584,7 @@ export class Engine {
18583
18584
  const names: string[] = []
18584
18585
  let n = 0
18585
18586
  this.forEachInCastOrder((inst) => {
18586
- if (n >= MAX_EFFECT_SUBJECTS || inst.isStage || inst.isPlane || inst.isProp || !inst.model.visible) return
18587
+ if (n >= MAX_EFFECT_SUBJECTS || inst.isStage || inst.isPlane || inst.isProp || !inst.model.drawn) return
18587
18588
  n++
18588
18589
  if (subjects && !subjects.includes(inst.name)) return
18589
18590
  names.push(inst.name)
@@ -19846,7 +19847,7 @@ export class Engine {
19846
19847
  let n = 0
19847
19848
  this.castSlotOf.clear()
19848
19849
  this.forEachInCastOrder((inst) => {
19849
- if (n >= MAX_EFFECT_SUBJECTS || inst.isStage || inst.isPlane || inst.isProp || !inst.model.visible) return
19850
+ if (n >= MAX_EFFECT_SUBJECTS || inst.isStage || inst.isPlane || inst.isProp || !inst.model.drawn) return
19850
19851
  const m = inst.model
19851
19852
  // WHO IS IN WHICH SLOT, recorded here because here is where it is
19852
19853
  // decided. An effect is aimed by model name, and a name only becomes a
@@ -20263,7 +20264,8 @@ export class Engine {
20263
20264
  skinMatrixBuffer: inst.skinMatrixBuffer,
20264
20265
  indexBuffer: inst.indexBuffer,
20265
20266
  draws,
20266
- hidden: (m) => inst.hiddenMaterials.has(m) || inst.morphHiddenMaterials.has(m),
20267
+ // A hidden model hides every material, whoever hid it (setVisible or the motion).
20268
+ hidden: (m) => !inst.model.drawn || inst.hiddenMaterials.has(m) || inst.morphHiddenMaterials.has(m),
20267
20269
  headSkin: () => (head >= 0 ? inst.model.getSkinMatrices().subarray(head * 16, head * 16 + 16) : null),
20268
20270
  headRest,
20269
20271
  layers: new Uint32Array(inst.objectLight.buffer)[0],
@@ -126,7 +126,12 @@ ${discard}
126
126
  // as burning away rather than as a stencil moving over her.
127
127
  var rz_burn = 0.0;
128
128
  if (material.dissolve < 0.9995) {
129
- let rz_t = input.faceT;
129
+ // PER FRAGMENT, from the bind-pose position: the pieces are the noise's,
130
+ // grit inside clumps, never the mesh's triangles, so a large face comes
131
+ // apart as finely as a small one. The prepass, the shadow map and the
132
+ // outline hull run the same function on the same interpolated input, so
133
+ // every pass agrees about which flakes are gone.
134
+ let rz_t = rz_dissolve_threshold(input.restPos);
130
135
  if (rz_t > material.dissolve) { discard; }
131
136
  // Put OUT as the last of her goes. Near zero the front is wider than what
132
137
  // is left of the surface, so every surviving fragment sits inside it and