reze-engine 0.69.9 → 0.70.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.
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAA6C,MAAM,QAAQ,CAAA;AAEpF,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAI5C,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EAEjB,UAAU,EASX,MAAM,aAAa,CAAA;AAgCpB,oCAAoC;AACpC,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;yDACqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAaD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;2EAE2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,CAAC,EAAE,MAAM,EAAE,CAAA;IACX,CAAC,EAAE,MAAM,EAAE,CAAA;CACZ;AAOD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACzC,QAAQ,EAAE,CAAC,MAAM,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,IAAI;CA0GhD"}
package/dist/model.js CHANGED
@@ -33,6 +33,60 @@ const smooth01 = (a, b, x) => {
33
33
  /** VRM's range map: `inMax` degrees of target offset onto `out` degrees of eye,
34
34
  * linearly — a look-at that never saturates. */
35
35
  const rangeMap = (v, inMax, out) => (Math.min(Math.abs(v), inMax) / inMax) * out * Math.sign(v);
36
+ // ─── Auto blink (see Model.setAutoBlink) ───
37
+ /** Morphs that close both eyes, in order of preference. */
38
+ const BLINK_BOTH = ["まばたき", "blink", "Blink", "eye_close", "Fcl_EYE_Close"];
39
+ /** Left and right pairs, for a model without one. ウィンク2 is the plain
40
+ * closed eye; ウィンク often comes with a smile, so it is the last resort. */
41
+ const BLINK_PAIRS = [
42
+ ["ウィンク2", "ウィンク2右"],
43
+ ["ウィンク2", "ウィンク2右"],
44
+ ["blink_L", "blink_R"],
45
+ ["Fcl_EYE_Close_L", "Fcl_EYE_Close_R"],
46
+ ["ウィンク", "ウィンク右"],
47
+ ["ウィンク", "ウィンク右"],
48
+ ["wink", "wink_R"],
49
+ ["Wink", "Wink_R"],
50
+ ];
51
+ /** A blink's shape at speed 1, seconds — about 0.33 s in all, the 6–8 frames
52
+ * an anime blink runs at 24 fps. Measured blinks close in 75–100 ms, rest shut
53
+ * 10–50 ms and open about twice as slowly, quick at first and then settling
54
+ * (the lid lifts against the orbit's pull), so the close is short and the
55
+ * open long with a tail. A symmetric ease reads mechanical. */
56
+ const BLINK_CLOSE = 0.09;
57
+ const BLINK_HOLD = 0.04;
58
+ const BLINK_OPEN = 0.2;
59
+ /** How often a blink is doubled, and how soon the second follows (at speed 1). */
60
+ const BLINK_DOUBLE = 0.15;
61
+ const BLINK_DOUBLE_GAP = 0.4;
62
+ /** A fixed value in 0..1 for an integer — the same sequence every take. */
63
+ const blinkHash = (n) => {
64
+ let h = Math.imul(n ^ 0x9e3779b9, 0x85ebca6b);
65
+ h = Math.imul(h ^ (h >>> 13), 0xc2b2ae35);
66
+ h ^= h >>> 16;
67
+ return (h >>> 0) / 4294967296;
68
+ };
69
+ const blinkGap = (n, interval) => interval * (0.5 + blinkHash(n));
70
+ /** How shut the eyes are t seconds into a blink at speed 1. The close is a
71
+ * quick smooth drop; the open leaves fast and settles slowly (a cubic ease-out,
72
+ * most of the lift in the first third and the rest a long approach to open). */
73
+ const blinkCurve = (t) => {
74
+ if (t < 0)
75
+ return 0;
76
+ if (t < BLINK_CLOSE) {
77
+ const x = t / BLINK_CLOSE;
78
+ return x * x * (3 - 2 * x);
79
+ }
80
+ t -= BLINK_CLOSE;
81
+ if (t < BLINK_HOLD)
82
+ return 1;
83
+ t -= BLINK_HOLD;
84
+ if (t < BLINK_OPEN) {
85
+ const x = 1 - t / BLINK_OPEN;
86
+ return x * x * x;
87
+ }
88
+ return 0;
89
+ };
36
90
  // Scratch for the post-physics append recovery — see applyPhysicsAppend.
37
91
  const _appendBasisX = new Vec3(0, 0, 0);
38
92
  const _appendBasisY = new Vec3(0, 0, 0);
@@ -273,6 +327,10 @@ export class Model {
273
327
  /** Set when the eyes are handed back, so the next update starts them from
274
328
  * rest before the pose sources run — see update(). */
275
329
  this.eyesReleased = false;
330
+ // ─── Auto blink ──────────────────────────────────────────────────────
331
+ /** The closing morphs auto blink drives (one for both eyes, or a left and
332
+ * right pair), or null while it is off. */
333
+ this.autoBlink = null;
276
334
  /**
277
335
  * IK bones whose chains are switched OFF at the current frame.
278
336
  *
@@ -894,6 +952,115 @@ export class Model {
894
952
  hasEyeTracking() {
895
953
  return this.eyeTracking !== null;
896
954
  }
955
+ /**
956
+ * Auto blink: she blinks every few seconds on her own, as eyes do — a
957
+ * natural irregular gap around `interval`, now and then a double blink.
958
+ *
959
+ * A MORPH, on the model's own closing morph (まばたき, or a left and right
960
+ * wink pair when there is none). It OWNS that morph while on, as eye
961
+ * tracking owns the eye bones: a morph motion's own まばたき keys are
962
+ * replaced, and handed back when it goes off. Its other expressions (a
963
+ * smile, a wince) play as keyed. Steps on the scene clock (the delta
964
+ * update() is handed, every frame, playing or paused) through a fixed
965
+ * sequence of gaps.
966
+ *
967
+ * Null hands the morph back. Returns false for a model with no closing morph.
968
+ */
969
+ setAutoBlink(options) {
970
+ if (!options) {
971
+ const b = this.autoBlink;
972
+ if (b) {
973
+ b.morphs.forEach((m, i) => (this.runtimeMorph.weights[m] = b.base[i]));
974
+ this.morphsDirty = true;
975
+ }
976
+ this.autoBlink = null;
977
+ return true;
978
+ }
979
+ const opts = {
980
+ interval: Math.min(10, Math.max(1, options.interval ?? 4)),
981
+ speed: Math.min(2, Math.max(0.5, options.speed ?? 1)),
982
+ double: options.double ?? true,
983
+ };
984
+ if (this.autoBlink) {
985
+ // A new interval takes from the next gap on; the current one stands.
986
+ this.autoBlink.options = opts;
987
+ return true;
988
+ }
989
+ const morphs = this.blinkMorphs();
990
+ if (!morphs)
991
+ return false;
992
+ const weights = this.runtimeMorph.weights;
993
+ this.autoBlink = {
994
+ morphs,
995
+ base: morphs.map((m) => weights[m]),
996
+ written: morphs.map((m) => weights[m]),
997
+ clock: 0,
998
+ start: -1,
999
+ next: blinkGap(0, opts.interval),
1000
+ count: 0,
1001
+ double: false,
1002
+ options: opts,
1003
+ };
1004
+ return true;
1005
+ }
1006
+ getAutoBlink() {
1007
+ return this.autoBlink ? { ...this.autoBlink.options } : null;
1008
+ }
1009
+ /** The morphs that close both eyes, by the names MMD, VRoid and the usual
1010
+ * converters give them. A smile or a wince closes them too and is no blink. */
1011
+ blinkMorphs() {
1012
+ const ni = this.runtimeMorph.nameIndex;
1013
+ for (const n of BLINK_BOTH)
1014
+ if (ni[n] !== undefined)
1015
+ return [ni[n]];
1016
+ for (const [l, r] of BLINK_PAIRS)
1017
+ if (ni[l] !== undefined && ni[r] !== undefined)
1018
+ return [ni[l], ni[r]];
1019
+ return null;
1020
+ }
1021
+ /** One frame of auto blink, after the pose sources set the morphs and before
1022
+ * they are applied. True when it moved a weight. */
1023
+ stepAutoBlink(dt) {
1024
+ const b = this.autoBlink;
1025
+ const { interval, speed, double } = b.options;
1026
+ const weights = this.runtimeMorph.weights;
1027
+ // A weight that is not what we wrote was set afresh this frame.
1028
+ for (let i = 0; i < b.morphs.length; i++) {
1029
+ const w = weights[b.morphs[i]];
1030
+ if (w !== b.written[i])
1031
+ b.base[i] = w;
1032
+ }
1033
+ if (dt > 0)
1034
+ b.clock += dt;
1035
+ // A seek back (or a scrub to the start) begins the sequence again.
1036
+ if (dt < 0) {
1037
+ b.clock = 0;
1038
+ b.start = -1;
1039
+ b.count = 0;
1040
+ b.double = false;
1041
+ b.next = blinkGap(0, interval);
1042
+ }
1043
+ // A loop, so a long jump forward lands on the blink it is in, not on each one passed.
1044
+ while (b.clock >= b.next) {
1045
+ b.start = b.next;
1046
+ b.count++;
1047
+ // Now and then a second blink follows straight after the first — never a third.
1048
+ b.double = double && !b.double && blinkHash(b.count * 7 + 3) < BLINK_DOUBLE;
1049
+ b.next = b.start + (b.double ? BLINK_DOUBLE_GAP / speed : blinkGap(b.count, interval));
1050
+ }
1051
+ const w = blinkCurve((b.clock - b.start) * speed);
1052
+ let changed = false;
1053
+ for (let i = 0; i < b.morphs.length; i++) {
1054
+ if (weights[b.morphs[i]] !== w) {
1055
+ weights[b.morphs[i]] = w;
1056
+ changed = true;
1057
+ }
1058
+ // Read back: the weights are float32, and a float64 kept here never
1059
+ // compares equal, so our own write passed for the motion's next frame.
1060
+ b.written[i] = weights[b.morphs[i]];
1061
+ }
1062
+ return changed;
1063
+ }
897
1064
  /**
898
1065
  * Where she looks: a unit direction in model space, or null for a model
899
1066
  * without eye bones. See RzSubject.gaze.
@@ -2521,6 +2688,9 @@ export class Model {
2521
2688
  const r = this.runtimeSkeleton.localRotations[idx];
2522
2689
  Quat.multiplyInto(r, offset, r);
2523
2690
  }
2691
+ // The blink over whatever the motion and the host set this frame.
2692
+ if (this.autoBlink !== null && this.stepAutoBlink(deltaTime))
2693
+ this.morphsDirty = true;
2524
2694
  // Apply morphs if tweens changed morphs or animation changed morphs
2525
2695
  const verticesChanged = this.morphsDirty || tweensChangedMorphs;
2526
2696
  if (this.morphsDirty || tweensChangedMorphs) {
@@ -1,2 +1,2 @@
1
- export declare const CULL_COMPUTE_WGSL = "\nstruct DrawMeta {\n lo: vec3f, // model-space AABB min \u2014 read only for RIGID models\n model: u32, // index into models[]\n hi: vec3f, // model-space AABB max\n flags: u32, // bit0 = casts shadow\n};\n\nstruct ModelRec {\n xform: mat4x4f, // model space -> world; meaningful only when RIGID\n sphere: vec4f, // world-space centre.xyz + radius.w; meaningful when SKINNED\n flags: u32, // bit0 = visible, bit1 = rigid\n pad0: u32,\n pad1: u32,\n pad2: u32,\n};\n\n// Camera planes at 0..5, light planes at 6..11, mirror planes at 12..17.\n// counts.x = draw count, counts.y = 0 to pass everything (setCullEnabled).\nstruct Frusta {\n planes: array<vec4f, 18>,\n counts: vec4u,\n};\n\n@group(0) @binding(0) var<storage, read> metas: array<DrawMeta>;\n@group(0) @binding(1) var<storage, read> models: array<ModelRec>;\n@group(0) @binding(2) var<uniform> frusta: Frusta;\n@group(0) @binding(3) var<storage, read_write> cameraArgs: array<u32>;\n@group(0) @binding(4) var<storage, read_write> shadowArgs: array<u32>;\n// 1 = the user hid this material, or a material morph drove its alpha to zero.\n// Here rather than in the encode loop because a render bundle bakes its draw\n// list: a face VMD rewrites the morph-hidden set every frame, so a bundle that\n// invalidated on it would re-record every frame and cost more than it saves.\n@group(0) @binding(5) var<storage, read> hidden: array<u32>;\n@group(0) @binding(6) var<storage, read_write> mirrorArgs: array<u32>;\n\nconst DRAW_CASTS_SHADOW: u32 = 1u;\nconst MODEL_VISIBLE: u32 = 1u;\nconst MODEL_RIGID: u32 = 2u;\n\n// Signed distance of the AABB's most-positive corner: the centre distance plus\n// the extent projected onto |n|. Negative means every corner is behind the\n// plane, which is the only case that can reject.\nfn aabbVisible(base: u32, c: vec3f, e: vec3f) -> bool {\n for (var i = 0u; i < 6u; i = i + 1u) {\n let p = frusta.planes[base + i];\n if (dot(p.xyz, c) + p.w + dot(e, abs(p.xyz)) < 0.0) { return false; }\n }\n return true;\n}\n\nfn sphereVisible(base: u32, s: vec4f) -> bool {\n for (var i = 0u; i < 6u; i = i + 1u) {\n let p = frusta.planes[base + i];\n if (dot(p.xyz, s.xyz) + p.w + s.w < 0.0) { return false; }\n }\n return true;\n}\n\n@compute @workgroup_size(64)\nfn cs(@builtin(global_invocation_id) gid: vec3<u32>) {\n let i = gid.x;\n if (i >= frusta.counts.x) { return; }\n\n // Named dm, not meta: \"meta\" is a WGSL reserved word (reserved for future use,\n // so it parses nowhere). No backticks anywhere in this string either \u2014 it is a\n // template literal, and one would end the shader mid-comment.\n let dm = metas[i];\n let m = models[dm.model];\n let visible = (m.flags & MODEL_VISIBLE) != 0u;\n\n var inCamera = false;\n var inLight = false;\n var inMirror = false;\n if (visible) {\n if ((m.flags & MODEL_RIGID) != 0u) {\n let c = (dm.lo + dm.hi) * 0.5;\n let e = (dm.hi - dm.lo) * 0.5;\n let wc = (m.xform * vec4f(c, 1.0)).xyz;\n // Extent of the transformed box: the abs of the linear part applied to the\n // half-extent. Exact for the axis-aligned case, conservative for a rotation.\n let a = mat3x3f(abs(m.xform[0].xyz), abs(m.xform[1].xyz), abs(m.xform[2].xyz));\n let we = a * e;\n inCamera = aabbVisible(0u, wc, we);\n inLight = aabbVisible(6u, wc, we);\n inMirror = aabbVisible(12u, wc, we);\n } else {\n inCamera = sphereVisible(0u, m.sphere);\n inLight = sphereVisible(6u, m.sphere);\n inMirror = sphereVisible(12u, m.sphere);\n }\n }\n\n // Culling off (setCullEnabled) passes everything, so a scene can be A/B'd\n // against its own unculled self without rebuilding anything. The pass still\n // runs, so the diagnostics keep reporting. It bypasses the FRUSTUM only \u2014\n // a hidden material is not culled, it is switched off, and answering \"is this\n // gone because of culling?\" requires the two to stay separable.\n let off = frusta.counts.y == 0u;\n // hidden: bit 0 switched off; bit 1 drawn by the native-material host\n // (unity/host.ts) rather than by its graph \u2014 no camera or mirror draw here,\n // and still its shadow, which the engine's pass casts for every material.\n let shown = (hidden[i] & 1u) == 0u;\n let graph = (hidden[i] & 2u) == 0u;\n let castsShadow = (dm.flags & DRAW_CASTS_SHADOW) != 0u;\n cameraArgs[i * 5u + 1u] = select(0u, 1u, (inCamera || off) && shown && graph);\n shadowArgs[i * 5u + 1u] = select(0u, 1u, ((inLight && castsShadow) || off) && shown);\n mirrorArgs[i * 5u + 1u] = select(0u, 1u, (inMirror || off) && shown && graph);\n}\n";
1
+ export declare const CULL_COMPUTE_WGSL = "\nstruct DrawMeta {\n lo: vec3f, // model-space AABB min \u2014 read only for RIGID models\n model: u32, // index into models[]\n hi: vec3f, // model-space AABB max\n flags: u32, // bit0 = casts shadow\n};\n\nstruct ModelRec {\n xform: mat4x4f, // model space -> world; meaningful only when RIGID\n sphere: vec4f, // world-space centre.xyz + radius.w; meaningful when SKINNED\n flags: u32, // bit0 = visible, bit1 = rigid\n pad0: u32,\n pad1: u32,\n pad2: u32,\n};\n\n// Camera planes at 0..5, light planes at 6..11, mirror planes at 12..17.\n// counts.x = draw count, counts.y = 0 to pass everything (setCullEnabled).\nstruct Frusta {\n planes: array<vec4f, 18>,\n counts: vec4u,\n};\n\n@group(0) @binding(0) var<storage, read> metas: array<DrawMeta>;\n@group(0) @binding(1) var<storage, read> models: array<ModelRec>;\n@group(0) @binding(2) var<uniform> frusta: Frusta;\n@group(0) @binding(3) var<storage, read_write> cameraArgs: array<u32>;\n@group(0) @binding(4) var<storage, read_write> shadowArgs: array<u32>;\n// 1 = the user hid this material, or a material morph drove its alpha to zero.\n// Here rather than in the encode loop because a render bundle bakes its draw\n// list: a face VMD rewrites the morph-hidden set every frame, so a bundle that\n// invalidated on it would re-record every frame and cost more than it saves.\n@group(0) @binding(5) var<storage, read> hidden: array<u32>;\n@group(0) @binding(6) var<storage, read_write> mirrorArgs: array<u32>;\n\nconst DRAW_CASTS_SHADOW: u32 = 1u;\nconst MODEL_VISIBLE: u32 = 1u;\nconst MODEL_RIGID: u32 = 2u;\n\n// Signed distance of the AABB's most-positive corner: the centre distance plus\n// the extent projected onto |n|. Negative means every corner is behind the\n// plane, which is the only case that can reject.\nfn aabbVisible(base: u32, c: vec3f, e: vec3f) -> bool {\n for (var i = 0u; i < 6u; i = i + 1u) {\n let p = frusta.planes[base + i];\n if (dot(p.xyz, c) + p.w + dot(e, abs(p.xyz)) < 0.0) { return false; }\n }\n return true;\n}\n\nfn sphereVisible(base: u32, s: vec4f) -> bool {\n for (var i = 0u; i < 6u; i = i + 1u) {\n let p = frusta.planes[base + i];\n if (dot(p.xyz, s.xyz) + p.w + s.w < 0.0) { return false; }\n }\n return true;\n}\n\n@compute @workgroup_size(64)\nfn cs(@builtin(global_invocation_id) gid: vec3<u32>) {\n let i = gid.x;\n if (i >= frusta.counts.x) { return; }\n\n // Named dm, not meta: \"meta\" is a WGSL reserved word (reserved for future use,\n // so it parses nowhere). No backticks anywhere in this string either \u2014 it is a\n // template literal, and one would end the shader mid-comment.\n let dm = metas[i];\n let m = models[dm.model];\n let visible = (m.flags & MODEL_VISIBLE) != 0u;\n\n var inCamera = false;\n var inLight = false;\n var inMirror = false;\n if (visible) {\n if ((m.flags & MODEL_RIGID) != 0u) {\n let c = (dm.lo + dm.hi) * 0.5;\n let e = (dm.hi - dm.lo) * 0.5;\n let wc = (m.xform * vec4f(c, 1.0)).xyz;\n // Extent of the transformed box: the abs of the linear part applied to the\n // half-extent. Exact for the axis-aligned case, conservative for a rotation.\n let a = mat3x3f(abs(m.xform[0].xyz), abs(m.xform[1].xyz), abs(m.xform[2].xyz));\n let we = a * e;\n inCamera = aabbVisible(0u, wc, we);\n inLight = aabbVisible(6u, wc, we);\n inMirror = aabbVisible(12u, wc, we);\n } else {\n inCamera = sphereVisible(0u, m.sphere);\n inLight = sphereVisible(6u, m.sphere);\n inMirror = sphereVisible(12u, m.sphere);\n }\n }\n\n // Culling off (setCullEnabled) passes everything, so a scene can be A/B'd\n // against its own unculled self without rebuilding anything. The pass still\n // runs, so the diagnostics keep reporting. It bypasses the FRUSTUM only \u2014\n // a hidden material is not culled, it is switched off, and answering \"is this\n // gone because of culling?\" requires the two to stay separable.\n let off = frusta.counts.y == 0u;\n // hidden: bit 0 switched off; bit 1 drawn by the native-material host\n // (unity/host.ts) rather than by its graph \u2014 no camera or mirror draw here,\n // and still its shadow, which the engine's pass casts for every material.\n let shown = (hidden[i] & 1u) == 0u;\n let graph = (hidden[i] & 2u) == 0u;\n // bit 2: kept out of the camera alone \u2014 her own head under a POV mount, which\n // her shadow and her mirror image still carry.\n let toCamera = (hidden[i] & 4u) == 0u;\n let castsShadow = (dm.flags & DRAW_CASTS_SHADOW) != 0u;\n cameraArgs[i * 5u + 1u] = select(0u, 1u, (inCamera || off) && shown && graph && toCamera);\n shadowArgs[i * 5u + 1u] = select(0u, 1u, ((inLight && castsShadow) || off) && shown);\n mirrorArgs[i * 5u + 1u] = select(0u, 1u, (inMirror || off) && shown && graph);\n}\n";
2
2
  //# sourceMappingURL=cull.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cull.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/cull.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,iBAAiB,ojJA6G7B,CAAA"}
1
+ {"version":3,"file":"cull.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/cull.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,iBAAiB,ovJAgH7B,CAAA"}
@@ -134,8 +134,11 @@ fn cs(@builtin(global_invocation_id) gid: vec3<u32>) {
134
134
  // and still its shadow, which the engine's pass casts for every material.
135
135
  let shown = (hidden[i] & 1u) == 0u;
136
136
  let graph = (hidden[i] & 2u) == 0u;
137
+ // bit 2: kept out of the camera alone — her own head under a POV mount, which
138
+ // her shadow and her mirror image still carry.
139
+ let toCamera = (hidden[i] & 4u) == 0u;
137
140
  let castsShadow = (dm.flags & DRAW_CASTS_SHADOW) != 0u;
138
- cameraArgs[i * 5u + 1u] = select(0u, 1u, (inCamera || off) && shown && graph);
141
+ cameraArgs[i * 5u + 1u] = select(0u, 1u, (inCamera || off) && shown && graph && toCamera);
139
142
  shadowArgs[i * 5u + 1u] = select(0u, 1u, ((inLight && castsShadow) || off) && shown);
140
143
  mirrorArgs[i * 5u + 1u] = select(0u, 1u, (inMirror || off) && shown && graph);
141
144
  }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Motion blur: a per-pixel velocity buffer and a gather along it.
3
+ *
4
+ * TWO PASSES, both run only while it is on (Engine.setMotionBlur):
5
+ *
6
+ * · VELOCITY. Every model is drawn again against the scene's own depth (read
7
+ * only, compare "ahead or equal"), so exactly the visible surface writes:
8
+ * where its pixel is now minus where the same skinned vertex was last frame
9
+ * — last frame's skin matrices and last frame's camera. Its own pass and its
10
+ * own pipelines, so no scene pipeline changes and nothing costs anything
11
+ * while blur is off. The same skinned vertex path and @invariant position as
12
+ * the depth prepass, so it lands on the depths the scene wrote; the same
13
+ * alpha cutout, dissolve and x-ray tests, so a hair card's holes do not
14
+ * claim the card's motion. The target holds (velocity × coverage, coverage)
15
+ * so the MSAA resolve averages an edge into a fraction instead of garbage.
16
+ *
17
+ * · GATHER, on the resolved HDR before bloom and the view transform (bloom
18
+ * then blooms the streak, as a camera's would). Where no model drew — the
19
+ * ground, the sky, a game stage — the motion is the CAMERA's, rebuilt from
20
+ * depth: the pixel's world point this frame, projected through last frame's
21
+ * camera. The blur is the pixel's own velocity × the shutter, a straight
22
+ * average of samples along it, clamped to a few percent of the frame.
23
+ *
24
+ * What it does not do (yet): a fast arm smears within itself, not out over a
25
+ * still background, which would take a neighbourhood max velocity (tile max).
26
+ * Morphs carry no motion: a blink is not blurred.
27
+ */
28
+ /** The velocity target: (velocity NDC xy × coverage, coverage, 1). */
29
+ export declare const MOTION_VELOCITY_FORMAT: GPUTextureFormat;
30
+ export declare function motionVelocityWgsl(): string;
31
+ /** Uniforms of the gather, in floats: invViewProj (16), prevViewProj (16),
32
+ * (scale, maxPx, width, height), (depthClear, 0, 0, 0). */
33
+ export declare const MOTION_BLUR_UNIFORM_FLOATS = 40;
34
+ export declare const MOTION_BLUR_WGSL = "\nstruct Uniforms {\n invViewProj: mat4x4f,\n prevViewProj: mat4x4f,\n // x: shutter scale (this frame's motion \u2192 streak), y: longest streak in px,\n // zw: target size in px.\n params: vec4f,\n // x: the depth a cleared pixel holds (the far plane, either end).\n depth: vec4f,\n};\n@group(0) @binding(0) var hdr: texture_2d<f32>;\n@group(0) @binding(1) var velocity: texture_2d<f32>;\n@group(0) @binding(2) var depthTex: texture_depth_multisampled_2d;\n@group(0) @binding(3) var<uniform> u: Uniforms;\n@group(0) @binding(4) var linearSampler: sampler;\n\nstruct VOut { @builtin(position) pos: vec4f, @location(0) uv: vec2f, };\n\n@vertex fn vs(@builtin(vertex_index) i: u32) -> VOut {\n let p = vec2f(f32((i << 1u) & 2u), f32(i & 2u));\n var o: VOut;\n o.pos = vec4f(p * 2.0 - 1.0, 0.0, 1.0);\n o.uv = vec2f(p.x, 1.0 - p.y);\n return o;\n}\n\nconst SAMPLES: i32 = 16;\n\n@fragment fn fs(in: VOut) -> @location(0) vec4f {\n let size = u.params.zw;\n let px = vec2i(in.pos.xy);\n let vel = textureLoad(velocity, px, 0);\n // The camera's share: where this pixel's world point was last frame.\n let ndc = vec2f(in.uv.x * 2.0 - 1.0, 1.0 - in.uv.y * 2.0);\n var d = textureLoad(depthTex, px, 0);\n // A cleared pixel is the far plane, which an infinite projection cannot\n // invert: nudged a hair inside it, it reprojects as a direction.\n d = select(min(d, 0.999999), max(d, 0.000001), u.depth.x < 0.5);\n let world = u.invViewProj * vec4f(ndc, d, 1.0);\n let prevClip = u.prevViewProj * vec4f(world.xyz / world.w, 1.0);\n let camVel = ndc - prevClip.xy / max(prevClip.w, 1e-5);\n // Where models drew, theirs, by how much of the pixel they cover.\n let v = vel.xy + (1.0 - clamp(vel.z, 0.0, 1.0)) * camVel;\n // NDC to pixels (y down), times the shutter, clamped.\n var streak = vec2f(v.x, -v.y) * 0.5 * size * u.params.x;\n let len = length(streak);\n if (len > u.params.y) { streak *= u.params.y / len; }\n let centre = textureLoad(hdr, px, 0);\n if (length(streak) < 0.5) { return centre; }\n var sum = vec3f(0.0);\n for (var i = 0; i < SAMPLES; i++) {\n let t = (f32(i) + 0.5) / f32(SAMPLES) - 0.5;\n let uv = in.uv + streak * t / size;\n sum += textureSampleLevel(hdr, linearSampler, uv, 0.0).rgb;\n }\n return vec4f(sum / f32(SAMPLES), centre.a);\n}\n";
35
+ //# sourceMappingURL=motion-blur.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion-blur.d.ts","sourceRoot":"","sources":["../../../src/shaders/passes/motion-blur.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,EAAE,gBAAgC,CAAA;AAErE,wBAAgB,kBAAkB,IAAI,MAAM,CA0E3C;AAED;4DAC4D;AAC5D,eAAO,MAAM,0BAA0B,KAAK,CAAA;AAE5C,eAAO,MAAM,gBAAgB,uwEAyD5B,CAAA"}
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Motion blur: a per-pixel velocity buffer and a gather along it.
3
+ *
4
+ * TWO PASSES, both run only while it is on (Engine.setMotionBlur):
5
+ *
6
+ * · VELOCITY. Every model is drawn again against the scene's own depth (read
7
+ * only, compare "ahead or equal"), so exactly the visible surface writes:
8
+ * where its pixel is now minus where the same skinned vertex was last frame
9
+ * — last frame's skin matrices and last frame's camera. Its own pass and its
10
+ * own pipelines, so no scene pipeline changes and nothing costs anything
11
+ * while blur is off. The same skinned vertex path and @invariant position as
12
+ * the depth prepass, so it lands on the depths the scene wrote; the same
13
+ * alpha cutout, dissolve and x-ray tests, so a hair card's holes do not
14
+ * claim the card's motion. The target holds (velocity × coverage, coverage)
15
+ * so the MSAA resolve averages an edge into a fraction instead of garbage.
16
+ *
17
+ * · GATHER, on the resolved HDR before bloom and the view transform (bloom
18
+ * then blooms the streak, as a camera's would). Where no model drew — the
19
+ * ground, the sky, a game stage — the motion is the CAMERA's, rebuilt from
20
+ * depth: the pixel's world point this frame, projected through last frame's
21
+ * camera. The blur is the pixel's own velocity × the shutter, a straight
22
+ * average of samples along it, clamped to a few percent of the frame.
23
+ *
24
+ * What it does not do (yet): a fast arm smears within itself, not out over a
25
+ * still background, which would take a neighbourhood max velocity (tile max).
26
+ * Morphs carry no motion: a blink is not blurred.
27
+ */
28
+ import { DISSOLVE_WGSL, JELLY_VERTEX_WGSL, OBJECT_LIGHT_STRUCT_WGSL, XRAY_WGSL } from "../materials/common";
29
+ /** The velocity target: (velocity NDC xy × coverage, coverage, 1). */
30
+ export const MOTION_VELOCITY_FORMAT = "rgba16float";
31
+ export function motionVelocityWgsl() {
32
+ return /* wgsl */ `
33
+ ${DISSOLVE_WGSL}
34
+ struct CameraUniforms { view: mat4x4f, projection: mat4x4f, viewPos: vec3f, _p: f32, };
35
+ // The head of the material block, as the depth prepass declares it.
36
+ struct MaterialUniforms {
37
+ diffuseColor: vec3f,
38
+ alpha: f32,
39
+ _skip0: vec4f,
40
+ _skip1: vec4f,
41
+ _skip2: f32,
42
+ materialId: f32,
43
+ _skip3: f32,
44
+ dissolve: f32,
45
+ };
46
+ struct PrevCamera { viewProj: mat4x4f, };
47
+
48
+ @group(0) @binding(0) var<uniform> camera: CameraUniforms;
49
+ @group(0) @binding(1) var<uniform> prevCamera: PrevCamera;
50
+ @group(0) @binding(2) var diffuseSampler: sampler;
51
+ @group(1) @binding(0) var<storage, read> skinMats: array<mat4x4f>;
52
+ ${OBJECT_LIGHT_STRUCT_WGSL}
53
+ @group(1) @binding(1) var<uniform> objectLight: ObjectLight;
54
+ @group(1) @binding(2) var<storage, read> prevSkinMats: array<mat4x4f>;
55
+ ${XRAY_WGSL}
56
+ ${JELLY_VERTEX_WGSL}
57
+ @group(2) @binding(0) var diffuseTexture: texture_2d<f32>;
58
+ @group(2) @binding(1) var<uniform> material: MaterialUniforms;
59
+
60
+ struct VSOut {
61
+ @builtin(position) @invariant position: vec4f,
62
+ @location(0) uv: vec2f,
63
+ @location(1) restPos: vec3f,
64
+ @location(2) clipNow: vec4f,
65
+ @location(3) clipPrev: vec4f,
66
+ };
67
+
68
+ @vertex fn vs(
69
+ @location(0) position: vec3f,
70
+ @location(1) normal: vec3f,
71
+ @location(2) uv: vec2f,
72
+ @location(3) joints0: vec4<u32>,
73
+ @location(4) weights0: vec4<f32>,
74
+ ) -> VSOut {
75
+ let weightSum = weights0.x + weights0.y + weights0.z + weights0.w;
76
+ let invWeightSum = select(1.0, 1.0 / weightSum, weightSum > 0.0001);
77
+ let w = select(vec4f(1.0, 0.0, 0.0, 0.0), weights0 * invWeightSum, weightSum > 0.0001);
78
+ var pos4 = vec4f(position, 1.0);
79
+ if (objectLight.jelly[0].w > 0.0) { pos4 = vec4f(rzJellyVertex(position, joints0, w), 1.0); }
80
+ var skinned = vec4f(0.0);
81
+ var prev = vec4f(0.0);
82
+ for (var i = 0u; i < 4u; i++) {
83
+ skinned += (skinMats[joints0[i]] * pos4) * w[i];
84
+ prev += (prevSkinMats[joints0[i]] * pos4) * w[i];
85
+ }
86
+ var o: VSOut;
87
+ o.position = camera.projection * camera.view * vec4f(skinned.xyz, 1.0);
88
+ o.uv = uv;
89
+ o.restPos = position;
90
+ o.clipNow = o.position;
91
+ o.clipPrev = prevCamera.viewProj * vec4f(prev.xyz, 1.0);
92
+ return o;
93
+ }
94
+
95
+ @fragment fn fs(in: VSOut) -> @location(0) vec4f {
96
+ let a = material.alpha * textureSample(diffuseTexture, diffuseSampler, in.uv).a;
97
+ if (a < 0.5) { discard; }
98
+ if (material.dissolve < 0.9995 && rz_dissolve_threshold(in.restPos) > material.dissolve) { discard; }
99
+ if (rz_xray_cut(in.position, material.materialId)) { discard; }
100
+ let now = in.clipNow.xy / in.clipNow.w;
101
+ let prev = in.clipPrev.xy / max(in.clipPrev.w, 1e-5);
102
+ return vec4f(now - prev, 1.0, 1.0);
103
+ }
104
+ `;
105
+ }
106
+ /** Uniforms of the gather, in floats: invViewProj (16), prevViewProj (16),
107
+ * (scale, maxPx, width, height), (depthClear, 0, 0, 0). */
108
+ export const MOTION_BLUR_UNIFORM_FLOATS = 40;
109
+ export const MOTION_BLUR_WGSL = /* wgsl */ `
110
+ struct Uniforms {
111
+ invViewProj: mat4x4f,
112
+ prevViewProj: mat4x4f,
113
+ // x: shutter scale (this frame's motion → streak), y: longest streak in px,
114
+ // zw: target size in px.
115
+ params: vec4f,
116
+ // x: the depth a cleared pixel holds (the far plane, either end).
117
+ depth: vec4f,
118
+ };
119
+ @group(0) @binding(0) var hdr: texture_2d<f32>;
120
+ @group(0) @binding(1) var velocity: texture_2d<f32>;
121
+ @group(0) @binding(2) var depthTex: texture_depth_multisampled_2d;
122
+ @group(0) @binding(3) var<uniform> u: Uniforms;
123
+ @group(0) @binding(4) var linearSampler: sampler;
124
+
125
+ struct VOut { @builtin(position) pos: vec4f, @location(0) uv: vec2f, };
126
+
127
+ @vertex fn vs(@builtin(vertex_index) i: u32) -> VOut {
128
+ let p = vec2f(f32((i << 1u) & 2u), f32(i & 2u));
129
+ var o: VOut;
130
+ o.pos = vec4f(p * 2.0 - 1.0, 0.0, 1.0);
131
+ o.uv = vec2f(p.x, 1.0 - p.y);
132
+ return o;
133
+ }
134
+
135
+ const SAMPLES: i32 = 16;
136
+
137
+ @fragment fn fs(in: VOut) -> @location(0) vec4f {
138
+ let size = u.params.zw;
139
+ let px = vec2i(in.pos.xy);
140
+ let vel = textureLoad(velocity, px, 0);
141
+ // The camera's share: where this pixel's world point was last frame.
142
+ let ndc = vec2f(in.uv.x * 2.0 - 1.0, 1.0 - in.uv.y * 2.0);
143
+ var d = textureLoad(depthTex, px, 0);
144
+ // A cleared pixel is the far plane, which an infinite projection cannot
145
+ // invert: nudged a hair inside it, it reprojects as a direction.
146
+ d = select(min(d, 0.999999), max(d, 0.000001), u.depth.x < 0.5);
147
+ let world = u.invViewProj * vec4f(ndc, d, 1.0);
148
+ let prevClip = u.prevViewProj * vec4f(world.xyz / world.w, 1.0);
149
+ let camVel = ndc - prevClip.xy / max(prevClip.w, 1e-5);
150
+ // Where models drew, theirs, by how much of the pixel they cover.
151
+ let v = vel.xy + (1.0 - clamp(vel.z, 0.0, 1.0)) * camVel;
152
+ // NDC to pixels (y down), times the shutter, clamped.
153
+ var streak = vec2f(v.x, -v.y) * 0.5 * size * u.params.x;
154
+ let len = length(streak);
155
+ if (len > u.params.y) { streak *= u.params.y / len; }
156
+ let centre = textureLoad(hdr, px, 0);
157
+ if (length(streak) < 0.5) { return centre; }
158
+ var sum = vec3f(0.0);
159
+ for (var i = 0; i < SAMPLES; i++) {
160
+ let t = (f32(i) + 0.5) / f32(SAMPLES) - 0.5;
161
+ let uv = in.uv + streak * t / size;
162
+ sum += textureSampleLevel(hdr, linearSampler, uv, 0.0).rgb;
163
+ }
164
+ return vec4f(sum / f32(SAMPLES), centre.a);
165
+ }
166
+ `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reze-engine",
3
- "version": "0.69.9",
3
+ "version": "0.70.0",
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",