reze-engine 0.13.5 → 0.15.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.
Files changed (124) hide show
  1. package/README.md +151 -87
  2. package/dist/camera.d.ts +2 -0
  3. package/dist/camera.d.ts.map +1 -1
  4. package/dist/camera.js +17 -0
  5. package/dist/engine.d.ts +72 -9
  6. package/dist/engine.d.ts.map +1 -1
  7. package/dist/engine.js +734 -16
  8. package/dist/index.d.ts +2 -2
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/model.d.ts +6 -0
  12. package/dist/model.d.ts.map +1 -1
  13. package/dist/model.js +36 -1
  14. package/dist/physics/body.d.ts +30 -0
  15. package/dist/physics/body.d.ts.map +1 -0
  16. package/dist/physics/body.js +215 -0
  17. package/dist/physics/constraint.d.ts +17 -0
  18. package/dist/physics/constraint.d.ts.map +1 -0
  19. package/dist/physics/constraint.js +102 -0
  20. package/dist/physics/contact.d.ts +32 -0
  21. package/dist/physics/contact.d.ts.map +1 -0
  22. package/dist/physics/contact.js +728 -0
  23. package/dist/physics/index.d.ts +4 -0
  24. package/dist/physics/index.d.ts.map +1 -0
  25. package/dist/physics/index.js +3 -0
  26. package/dist/physics/physics.d.ts +31 -0
  27. package/dist/physics/physics.d.ts.map +1 -0
  28. package/dist/physics/physics.js +211 -0
  29. package/dist/physics/solver.d.ts +5 -0
  30. package/dist/physics/solver.d.ts.map +1 -0
  31. package/dist/physics/solver.js +416 -0
  32. package/dist/physics/types.d.ts +46 -0
  33. package/dist/physics/types.d.ts.map +1 -0
  34. package/dist/physics/types.js +12 -0
  35. package/dist/physics/world.d.ts +12 -0
  36. package/dist/physics/world.d.ts.map +1 -0
  37. package/dist/physics/world.js +146 -0
  38. package/dist/physics-debug.d.ts +30 -0
  39. package/dist/physics-debug.d.ts.map +1 -0
  40. package/dist/physics-debug.js +526 -0
  41. package/dist/shaders/materials/body.d.ts +1 -1
  42. package/dist/shaders/materials/cloth_rough.d.ts +1 -1
  43. package/dist/shaders/materials/cloth_smooth.d.ts +1 -1
  44. package/dist/shaders/materials/common.d.ts +1 -1
  45. package/dist/shaders/materials/common.js +2 -2
  46. package/dist/shaders/materials/default.d.ts +1 -1
  47. package/dist/shaders/materials/eye.d.ts +1 -1
  48. package/dist/shaders/materials/face.d.ts +1 -1
  49. package/dist/shaders/materials/hair.d.ts +1 -1
  50. package/dist/shaders/materials/hair.d.ts.map +1 -1
  51. package/dist/shaders/materials/hair.js +2 -2
  52. package/dist/shaders/materials/metal.d.ts +1 -1
  53. package/dist/shaders/materials/stockings.d.ts +1 -1
  54. package/dist/shaders/passes/gizmo.d.ts +2 -0
  55. package/dist/shaders/passes/gizmo.d.ts.map +1 -0
  56. package/dist/shaders/passes/gizmo.js +75 -0
  57. package/dist/shaders/passes/physics-debug.d.ts +2 -0
  58. package/dist/shaders/passes/physics-debug.d.ts.map +1 -0
  59. package/dist/shaders/passes/physics-debug.js +69 -0
  60. package/dist/shaders/passes/pick.d.ts +1 -1
  61. package/dist/shaders/passes/pick.d.ts.map +1 -1
  62. package/dist/shaders/passes/pick.js +29 -5
  63. package/dist/shaders/passes/selection.d.ts +3 -0
  64. package/dist/shaders/passes/selection.d.ts.map +1 -0
  65. package/dist/shaders/passes/selection.js +65 -0
  66. package/package.json +3 -6
  67. package/src/camera.ts +14 -0
  68. package/src/engine.ts +836 -19
  69. package/src/index.ts +4 -1
  70. package/src/model.ts +38 -1
  71. package/src/physics/body.ts +305 -0
  72. package/src/physics/constraint.ts +151 -0
  73. package/src/physics/contact.ts +983 -0
  74. package/src/physics/index.ts +8 -0
  75. package/src/physics/physics.ts +255 -0
  76. package/src/physics/solver.ts +430 -0
  77. package/src/physics/types.ts +50 -0
  78. package/src/physics/world.ts +152 -0
  79. package/src/shaders/materials/common.ts +2 -2
  80. package/src/shaders/materials/hair.ts +2 -2
  81. package/src/shaders/passes/gizmo.ts +76 -0
  82. package/src/shaders/passes/pick.ts +29 -5
  83. package/src/shaders/passes/selection.ts +67 -0
  84. package/dist/ammo-loader.d.ts +0 -3
  85. package/dist/ammo-loader.d.ts.map +0 -1
  86. package/dist/ammo-loader.js +0 -26
  87. package/dist/physics.d.ts +0 -86
  88. package/dist/physics.d.ts.map +0 -1
  89. package/dist/physics.js +0 -527
  90. package/dist/shaders/body.d.ts +0 -2
  91. package/dist/shaders/body.d.ts.map +0 -1
  92. package/dist/shaders/body.js +0 -199
  93. package/dist/shaders/classify.d.ts +0 -4
  94. package/dist/shaders/classify.d.ts.map +0 -1
  95. package/dist/shaders/classify.js +0 -12
  96. package/dist/shaders/cloth_rough.d.ts +0 -2
  97. package/dist/shaders/cloth_rough.d.ts.map +0 -1
  98. package/dist/shaders/cloth_rough.js +0 -178
  99. package/dist/shaders/cloth_smooth.d.ts +0 -2
  100. package/dist/shaders/cloth_smooth.d.ts.map +0 -1
  101. package/dist/shaders/cloth_smooth.js +0 -174
  102. package/dist/shaders/default.d.ts +0 -2
  103. package/dist/shaders/default.d.ts.map +0 -1
  104. package/dist/shaders/default.js +0 -171
  105. package/dist/shaders/eye.d.ts +0 -2
  106. package/dist/shaders/eye.d.ts.map +0 -1
  107. package/dist/shaders/eye.js +0 -146
  108. package/dist/shaders/face.d.ts +0 -2
  109. package/dist/shaders/face.d.ts.map +0 -1
  110. package/dist/shaders/face.js +0 -199
  111. package/dist/shaders/hair.d.ts +0 -2
  112. package/dist/shaders/hair.d.ts.map +0 -1
  113. package/dist/shaders/hair.js +0 -176
  114. package/dist/shaders/metal.d.ts +0 -2
  115. package/dist/shaders/metal.d.ts.map +0 -1
  116. package/dist/shaders/metal.js +0 -174
  117. package/dist/shaders/nodes.d.ts +0 -2
  118. package/dist/shaders/nodes.d.ts.map +0 -1
  119. package/dist/shaders/nodes.js +0 -456
  120. package/dist/shaders/stockings.d.ts +0 -2
  121. package/dist/shaders/stockings.d.ts.map +0 -1
  122. package/dist/shaders/stockings.js +0 -244
  123. package/src/ammo-loader.ts +0 -31
  124. package/src/physics.ts +0 -706
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Reze Engine
2
2
 
3
- A minimal-dependency WebGPU engine for real-time MMD/PMX rendering. Only external dependency is Ammo.js for physics.
3
+ **Zero-runtime-dependency** WebGPU engine for real-time MMD/PMX rendering. Pure TypeScript renderer, animation, IK, physics, all hand-written. The only `dependencies` entry is `@webgpu/types` and that's types-only; no JS at runtime.
4
4
 
5
5
  ![screenshot](./screenshot.png)
6
6
 
@@ -17,8 +17,9 @@ npm install reze-engine
17
17
  - **HDR pipeline** with bloom mip pyramid, Filmic tone mapping, 4× MSAA, tile-memory-friendly on Apple Silicon
18
18
  - **Alpha-hashed transparency** (Wyman & McGuire 2017) for self-overlapping transparent meshes like stockings
19
19
  - **Screen-space outlines** on opaque + transparent materials
20
- - **See-through hair over eyes** — stencil-gated MMD post-alpha-eye so eyes read at 50% through hair silhouettes
21
- - **VMD animation** with IK solver and Bullet physics
20
+ - **See-through hair over eyes** — stencil-gated MMD post-alpha-eye so eyes read at 75% through hair silhouettes
21
+ - **In-house TS physics** sequential-impulse 6DOF spring solver, sphere/box/capsule contacts, split-impulse position correction, fixed-step substepping
22
+ - **VMD animation** with IK solver
22
23
  - **Orbit camera** with bone-follow mode
23
24
  - **GPU picking** (double-click/tap)
24
25
  - **Ground plane** with PCF shadow mapping
@@ -109,32 +110,36 @@ engine.dispose()
109
110
 
110
111
  Use a hidden `<input type="file" webkitdirectory multiple>` (or drag/drop) and pass the resulting `FileList` or `File[]` into the engine. Textures resolve relative to the chosen PMX file inside that tree.
111
112
 
112
- **Important:** read `input.files` into a normal array **before** setting `input.value = ""`. The browsers `FileList` is _live_ — clearing the input empties it.
113
+ **Important:** read `input.files` into a normal array **before** setting `input.value = ""`. The browser's `FileList` is _live_ — clearing the input empties it.
113
114
 
114
115
  1. **`parsePmxFolderInput(fileList)`** — returns a tagged result (`empty` | `not_directory` | `no_pmx` | `single` | `multiple`). For `single`, you already have `files` and `pmxFile`. For `multiple`, show a picker (dropdown) of `pmxRelativePaths`, then resolve with **`pmxFileAtRelativePath(files, path)`**.
115
116
  2. **`engine.loadModel(name, { files, pmxFile })`** — `pmxFile` selects which `.pmx` when the folder contains several.
116
117
 
117
118
  ```javascript
118
- import { Engine, parsePmxFolderInput, pmxFileAtRelativePath } from "reze-engine"
119
+ import {
120
+ Engine,
121
+ parsePmxFolderInput,
122
+ pmxFileAtRelativePath,
123
+ } from "reze-engine";
119
124
 
120
125
  // In <input onChange>:
121
- const picked = parsePmxFolderInput(e.target.files)
122
- e.target.value = ""
126
+ const picked = parsePmxFolderInput(e.target.files);
127
+ e.target.value = "";
123
128
 
124
129
  if (picked.status === "single") {
125
130
  const model = await engine.loadModel("myModel", {
126
131
  files: picked.files,
127
132
  pmxFile: picked.pmxFile,
128
- })
133
+ });
129
134
  }
130
135
 
131
136
  if (picked.status === "multiple") {
132
137
  // Let the user choose `chosenPath` from picked.pmxRelativePaths, then:
133
- const pmxFile = pmxFileAtRelativePath(picked.files, chosenPath)
138
+ const pmxFile = pmxFileAtRelativePath(picked.files, chosenPath);
134
139
  const model = await engine.loadModel("myModel", {
135
140
  files: picked.files,
136
141
  pmxFile,
137
- })
142
+ });
138
143
  }
139
144
  ```
140
145
 
@@ -162,6 +167,22 @@ model.setMorphWeight(name, weight, ms?)
162
167
  model.resetAllBones()
163
168
  model.resetAllMorphs()
164
169
  model.getBoneWorldPosition(name)
170
+
171
+ // Direct bone local-transform accessors (used by interactive gizmo drag).
172
+ // Readers return the live runtime state; snapshot with .clone() if needed.
173
+ model.getBoneLocalRotation(boneIndex)
174
+ model.getBoneLocalTranslation(boneIndex)
175
+
176
+ // Raw absolute-local translation write. NOT the same as moveBones({ n: v }, 0)
177
+ // — moveBones treats input as VMD-relative and converts. Use this when you
178
+ // already have the final local translation. For rotation, rotateBones(..., 0)
179
+ // is already an instant-write equivalent.
180
+ model.setBoneLocalTranslation(boneIndex, vec3)
181
+
182
+ // Freeze clip re-sampling so direct writes persist across frames. Auto-cleared
183
+ // on play() / seek(). See "Interactive pose editing" below.
184
+ model.setClipApplySuspended(suspended: boolean)
185
+ model.isClipApplySuspended()
165
186
  ```
166
187
 
167
188
  #### Animation data
@@ -173,12 +194,12 @@ model.getBoneWorldPosition(name)
173
194
  `model.exportVmd(name)` serialises a loaded clip back to the VMD binary format and returns an `ArrayBuffer`. Bone and morph names are Shift-JIS encoded for compatibility with standard MMD tools.
174
195
 
175
196
  ```javascript
176
- const buffer = model.exportVmd("idle")
177
- const blob = new Blob([buffer], { type: "application/octet-stream" })
178
- const link = document.createElement("a")
179
- link.href = URL.createObjectURL(blob)
180
- link.download = "idle.vmd"
181
- link.click()
197
+ const buffer = model.exportVmd("idle");
198
+ const blob = new Blob([buffer], { type: "application/octet-stream" });
199
+ const link = document.createElement("a");
200
+ link.href = URL.createObjectURL(blob);
201
+ link.download = "idle.vmd";
202
+ link.click();
182
203
  ```
183
204
 
184
205
  #### Playback
@@ -209,10 +230,8 @@ Blender-style scene config — `world` = environment lighting, `sun` = the direc
209
230
  target: Vec3,
210
231
  fov: number, // radians
211
232
  },
212
- onRaycast: (modelName, material, screenX, screenY) => void,
213
- physicsOptions: {
214
- constraintSolverKeywords: string[],
215
- },
233
+ onRaycast: (modelName, material, bone, screenX, screenY) => void,
234
+ onGizmoDrag: (event: GizmoDragEvent) => void,
216
235
  }
217
236
  ```
218
237
 
@@ -220,103 +239,148 @@ The shadow map is cast from `sun.direction` — same vector the shader lights wi
220
239
 
221
240
  `engine.setWorld({ color?, strength? })` and `engine.setSun({ color?, strength?, direction? })` update lighting at runtime; changing `sun.direction` refreshes the shadow VP on the next frame.
222
241
 
223
- `constraintSolverKeywords` joints whose name contains any keyword use the Bullet 2.75 constraint solver; all others keep the stable Ammo 2.82+ default. See [babylon-mmd: Fix Constraint Behavior](https://noname0310.github.io/babylon-mmd/docs/reference/runtime/apply-physics-to-mmd-models/#fix-constraint-behavior) for details.
224
-
225
- ## Rendering
242
+ ### Interactive pose editing
226
243
 
227
- Each surface combines an NPR stack with a Principled-style BSDF, mixed per material so anime characters keep their flat illustrated look while highlights and reflections stay grounded. Every per-material shader is ~40–120 lines of distinctive code standing on a small set of shared WGSL primitives (`engine/src/shaders/materials/`).
244
+ Dblclick picks a bone or material; a transform gizmo (rings + axes, local-axis aligned) drags the selection. The engine does NOT write to the skeleton on its own it fires a callback with the computed target local transform and the host picks a write policy (runtime override, tween, clip keyframe edit).
228
245
 
229
- ### Anatomy of a material shader
246
+ **Pick callback.** Fires on dblclick. `modelName` is `""` when the click missed the mesh. `material` and `bone` are both resolved for every hit (per-triangle dominant-joint from the GPU pick), so a single handler can serve both material-mode and bone-mode toggles:
230
247
 
231
- Every material's fragment shader is the same 7-stage pipeline. The order is fixed; the content is per-material:
248
+ ```javascript
249
+ onRaycast: (modelName, material, bone, screenX, screenY) => { ... }
232
250
 
251
+ engine.setSelectedMaterial(modelName | null, materialName | null) // orange screen-space selection outline
252
+ engine.setSelectedBone(modelName | null, boneName | null) // shows the rings+axes gizmo at this bone
233
253
  ```
234
- (A) Fragment setup → n, v, l, sun, amb, shadow ← shared
235
- (B) Texture + alpha → tex_rgb, discard ← shared shape
236
- (C) NPR stack → toon + rim + warm + … ← UNIQUE per material
237
- (D) Optional bump → noise → bump_lh ← 3 presets
238
- (E) Principled BSDF → eval_principled(...) ← shared helper
239
- (F) NPR ↔ PBR mix → mix(npr, principled, fac) ← per-material fac
240
- (G) FSOut → color + bloom mask ← shared
254
+
255
+ **Gizmo drag callback.** The engine only reports; you apply:
256
+
257
+ ```typescript
258
+ type GizmoDragEvent = {
259
+ modelName: string
260
+ boneName: string
261
+ boneIndex: number
262
+ kind: "rotate" | "translate"
263
+ localRotation: Quat // target absolute local rotation
264
+ localTranslation: Vec3 // target absolute local translation
265
+ phase?: "start" | "end" // undefined during drag moves
266
+ }
241
267
  ```
242
268
 
243
- The simplest material (`default`) uses only A/B/E/Gno NPR stack at all:
269
+ Fires once with `phase: "start"` on mousedown, on every mousemove (no phase), once with `phase: "end"` on mouseup. While drag is active the engine consumes any mouse input inside the gizmo's bounding sphere so camera orbit never conflicts with a drag mousedown outside the sphere routes to camera as normal.
270
+
271
+ **Two write strategies**, depending on whether you keep a clip on disk:
244
272
 
245
- ```wgsl
246
- let color = eval_principled(
247
- PrincipledIn(albedo, 0.0, 0.5, 0.5, 1e30, 0.0, 0.0), // metallic, spec, rough, clamp, sheen, sheen_tint
248
- n, l, v, sun, amb, shadow
249
- );
273
+ ```javascript
274
+ // Runtime override (no clip editor — this is what web/page.tsx does).
275
+ onGizmoDrag: (e) => {
276
+ const model = engine.getModel(e.modelName)
277
+ if (!model) return
278
+ if (e.phase === "start") {
279
+ model.pause()
280
+ model.setClipApplySuspended(true) // stop clip re-sampling from wiping the edit
281
+ return
282
+ }
283
+ if (e.phase === "end") return
284
+ if (e.kind === "rotate")
285
+ model.rotateBones({ [e.boneName]: e.localRotation }, 0) // 0 = instant write
286
+ else
287
+ model.setBoneLocalTranslation(e.boneIndex, e.localTranslation)
288
+ }
289
+ // Pressing play/seek auto-clears the suspend flag → animation resumes, edit is lost
290
+ // (expected runtime-override semantic).
291
+
292
+ // Keyframe edit (animation editor — studio-style).
293
+ onGizmoDrag: (e) => {
294
+ if (e.phase === "start") { beginUndoGroup(); return }
295
+ if (e.phase === "end") { commitUndoGroup(); return }
296
+ const kf = findOrCreateKeyframe(clip, e.boneName, currentFrame)
297
+ kf.rotation = e.localRotation
298
+ kf.translation = e.localTranslation
299
+ model.loadClip(clipName, clip)
300
+ model.seek(currentTime)
301
+ // The re-sampled clip now produces the edited pose — no suspend flag needed.
302
+ }
250
303
  ```
251
304
 
252
- NPR presets add stage C (and sometimes D) on top, and stage F chooses how NPR-leaning the surface is.
305
+ Note the asymmetry: rotation uses `rotateBones({ name, q }, 0)` (the tween-based API reduces to an instant write when duration is 0) while translation uses `setBoneLocalTranslation(idx, v)` `moveBones` can't be used because it converts VMD-relative input to local, and the gizmo's output is already local.
253
306
 
254
- ### Shared WGSL foundations
307
+ ## Physics
255
308
 
256
- - **`nodes.ts`** WGSL mirrors of the Blender shader nodes the presets use: `hue_sat`, `bright_contrast`, `ramp_constant/linear/cardinal`, `mix_overlay/lighten/linear_light`, `fresnel`, `layer_weight_fresnel/facing`, `tex_noise`, `tex_voronoi`, `mapping_point`, `bump_lh`, `normal_map`. Plus a combined DFG + LTC LUT, `eval_principled(PrincipledIn, N, L, V, sun, amb, shadow)`, and `principled_sheen`.
257
- - **`common.ts`** — Uniform structs, bind-group layout (same for every material pipeline), PCF shadow sampler, skinning vertex shader, shared `FSOut`.
258
- - **Per-material files** — constants + NPR stack + optional bump + `eval_principled` call + final mix.
309
+ Hand-written sequential-impulse rigid-body solver, no external physics dependency. Targets PMX rigs (sphere / box / capsule colliders, 6DOF spring joints) at quality comparable to Bullet's defaults but in ~1.5k lines of TypeScript.
259
310
 
260
- ### PBR specular core
311
+ ### Pipeline
261
312
 
262
- Inside `eval_principled`:
313
+ Per substep:
263
314
 
264
- - GGX microfacet specular with Schlick Fresnel and Walter–Smith G1
265
- - **Multi-scatter compensation** (Fdez-Agüera 2019) restores energy at high roughness so metals don't darken
266
- - **Split-sum DFG LUT** (Karis 2013) — drives indirect specular
267
- - **LTC direct-spec scale** (Heitz 2016) — keeps analytic-light specular in the same energy budget as image-based lighting
268
- - **Sheen coarse curve** gated by the `sheen` field on `PrincipledIn`
315
+ ```
316
+ predict velocities → broadphase + narrowphase → solve constraints (10 iters)
317
+ split-impulse position correction → integrate transforms
318
+ ```
269
319
 
270
- ### NPR toolbox
320
+ A fixed-timestep accumulator runs the substep at a constant **75 Hz** regardless of render rate, with up to 10 substeps per render frame. Constant `dt` keeps spring impulse, damping, and integration deterministic — without it, coupled cloth chains never reach steady state.
271
321
 
272
- Every preset's stage C is built from these primitives:
322
+ ### Implementation notes
273
323
 
274
- - **Toon ramps** — quantised NdotL through constant or `ramp_constant_edge_aa` (fwidth-based step anti-alias) for cel-shaded shadow terminators
275
- - **HSV remaps** — separate hue/sat/value tints for shadow vs lit zones, layered with mix-overlay against the lit texture for warm-shadow / cool-light shifts
276
- - **Fresnel rim & layer-weight wrap** — `fresnel × layer_weight_facing` (or two stacked fresnels) feeds a MixShader against an emissive backdrop for anime back-light
277
- - **Procedural micro-detail** — 3-octave value noise (PCG hash, fully unrolled) drives bump-from-height for skin and fabric; 3D Voronoi in reflection-coord space drives metallic sparkle
278
- - **Selective emission** — BT.601-luminance-gated boosts (eye iris, face highlights, stockings pattern) that survive into bloom
324
+ - **Solver** — projected Gauss-Seidel sequential impulse, 10 iterations, joint rows + contact rows in the same loop. Joint constraints are 6DOF springs (3 linear, 3 angular) with stop-ERP for limit correction and a per-axis spring impulse driven by stiffness × position error.
325
+ - **Narrowphase** — analytical per pair: sphere-sphere, sphere-capsule, sphere-box, capsule-capsule, capsule-box. Capsule-capsule emits multiple contact points along nearly-parallel axes for rotational stability (otherwise a single closest-point contact lets cloth pivot freely around the line through that point).
326
+ - **Speculative contacts** — `CONTACT_MARGIN = 0.04` fires contacts at near-touch with signed depth. The push-only impulse clamp keeps them inert until actual overlap, but they prevent fast bodies from crossing a thin surface in a single substep.
327
+ - **Split-impulse position correction** — penetration is resolved by a direct mass-weighted translation along the contact normal *outside* the velocity solver, so joint pulls in the SI loop can't fight the contact's separation.
328
+ - **Kinematic velocity propagation** — bone-driven kinematic bodies have their linear + angular velocities derived from the bone-pose delta each render frame, so joints attached to a fast limb feel the actual motion instead of a position teleport.
329
+ - **Body sleeping** is disabled (cloth must always respond to bone motion); resting bodies rely on per-PMX damping to bleed off micro-velocity.
279
330
 
280
- ### Per-material NPR stacks
331
+ ### API
281
332
 
282
- Each PMX material is assigned to one of these shaders. The NPR stack column is what's actually in stage C of that file; the Principled column is what gets passed to `eval_principled`.
333
+ ```javascript
334
+ engine.setPhysicsEnabled(enabled)
335
+ engine.resetPhysics() // re-snap bodies to bone poses, zero velocities
336
+ ```
283
337
 
284
- | Preset | NPR stack (stage C) | Principled (stage E) |
285
- | -------------- | ----------------------------------------------------------- | ------------------------------------------------------------- |
286
- | `default` | — | metallic=0, spec=0.5, rough=0.5 |
287
- | `eye` | — (emission = albedo × 1.5 added post-eval) | same as default |
288
- | `face` | toon + warm rim + dual-fresnel rim + BT.601 bright-tex gate | spec=0.5, rough=0.3, noise bump, spec clamp=10 |
289
- | `body` | toon + warm rim + fresnel rim + facing rim | spec=0.5, rough=0.3, noise bump, spec clamp=10 |
290
- | `hair` | toon + fresnel rim + bevel (n.y) + bright-tex gate | spec=1.0, rough=0.3, mixed at 20% PBR |
291
- | `cloth_smooth` | toon + bevel + mix-overlay emission (×18) | spec=0.8, rough=0.5 |
292
- | `cloth_rough` | same NPR as `cloth_smooth` | spec=0.8, rough=0.82, live noise bump, spec clamp=10 |
293
- | `metal` | toon + mix-overlay emission (×8) | metallic=1, voronoi-driven base (reflection-coord), rough=0.3 |
294
- | `stockings` | gradient × facing mask + HSV-boosted emission (×5) | metallic=0.1, spec=1, rough=0.5, **sheen=0.7**, hashed alpha |
338
+ That's the entire engine-level surface physics options live on the PMX rig itself (mass, damping, friction, restitution, joint stiffness / limits, collision groups).
295
339
 
296
- Assign presets per-model with `engine.setMaterialPresets(name, map)` (see the [Usage](#usage) example). Material names not listed fall through to `default`.
340
+ ## Rendering
297
341
 
298
- ### Shadows, post, output
342
+ Each surface combines an NPR stack with a Principled-style BSDF, mixed per material — anime characters keep their flat illustrated look while highlights and reflections stay grounded. Per-material shaders live in `engine/src/shaders/materials/`.
299
343
 
300
- - Directional shadow map (2048², depth32float, PCF, normal + depth bias)
301
- - HDR main pass with 4× MSAA. Color is `rg11b10ufloat` paired with an `rg8unorm` aux MRT carrying bloom mask (`.r`) and accumulated alpha (`.g`). The combined footprint fits Apple Silicon TBDR tile memory, so the 4× MSAA buffer resolves in-tile rather than spilling to system memory every frame. Falls back to `rgba16float` when the device does not expose `rg11b10ufloat-renderable`.
302
- - Bloom via threshold + downsample/upsample mip pyramid, gated by the aux bloom-mask channel
303
- - Filmic tone mapping (LUT extracted from Blender 3.6 OCIO "Filmic / Medium High Contrast")
304
- - Screen-space outline pass (inverted-hull) on opaque and transparent materials
344
+ ### Material pipeline
345
+
346
+ Every fragment shader follows the same 7-stage layout (shared stages from `nodes.ts` / `common.ts`):
347
+
348
+ ```
349
+ (A) Fragment setup → (B) Texture + alpha → (C) NPR stack → (D) Optional bump
350
+ → (E) Principled BSDF → (F) NPR ↔ PBR mix → (G) FSOut
351
+ ```
352
+
353
+ The `default` preset uses only A/B/E/G; NPR presets layer C (and sometimes D) on top, with stage F choosing how NPR-leaning the final result is.
354
+
355
+ **PBR core** (`eval_principled`) — GGX microfacet with Schlick Fresnel, Walter–Smith G1, Fdez-Agüera 2019 multi-scatter compensation, Karis 2013 split-sum DFG LUT, Heitz 2016 LTC direct-spec scaling, optional sheen.
305
356
 
306
- ### Alpha-hashed transparency
357
+ **NPR toolbox** — toon ramps (constant or fwidth-AA'd), HSV warm-shadow / cool-light remaps, fresnel + layer-weight rims, value-noise bump, 3D Voronoi metallic sparkle, BT.601-luminance-gated emission.
307
358
 
308
- `stockings` uses the Wyman & McGuire 2017 derivative-aware stochastic discard so self-overlapping transparent meshes (e.g. the front and back of a stocking wrapped around a leg) resolve cleanly under MSAA with opaque-style depth writes. The hash is derived from world-space position, so the dither pattern does not swim when the camera moves.
359
+ | Preset | Notes |
360
+ | -------------- | ------------------------------------------------------------------------------- |
361
+ | `default` | Plain Principled, metallic=0, rough=0.5 |
362
+ | `eye` | Plain + post-eval emission ×1.5 |
363
+ | `face` | Toon + warm rim + dual-fresnel rim + bright-tex gate, noise bump |
364
+ | `body` | Toon + warm rim + fresnel + facing rim, noise bump |
365
+ | `hair` | Toon + fresnel + bevel + bright-tex gate, mixed at 20% PBR |
366
+ | `cloth_smooth` | Toon + bevel + emission overlay (×18) |
367
+ | `cloth_rough` | Same NPR as cloth_smooth, live noise bump, rough=0.82 |
368
+ | `metal` | Toon + emission overlay (×8), voronoi base, metallic=1 |
369
+ | `stockings` | Gradient × facing mask + HSV emission (×5), sheen=0.7, **alpha-hashed** |
309
370
 
310
- ### See-through hair over eyes (MMD post-alpha-eye)
371
+ Assign per-model with `engine.setMaterialPresets(name, map)`. Unlisted material names fall through to `default`.
311
372
 
312
- The classic MMD effect where hair strands covering the eye are rendered at 50% so the iris stays readable — implemented as a single extra pass driven by the stencil buffer, not a two-texture composite.
373
+ ### Post & output
374
+
375
+ - Directional shadow map (2048², depth32float, PCF, normal + depth bias)
376
+ - HDR main pass at 4× MSAA, `rg11b10ufloat` color + `rg8unorm` aux MRT (bloom mask + accumulated alpha) — fits Apple Silicon TBDR tile memory so MSAA resolves in-tile. Falls back to `rgba16float` when `rg11b10ufloat-renderable` isn't available.
377
+ - Bloom: threshold + downsample/upsample mip pyramid, gated by aux bloom mask
378
+ - Filmic tone mapping (LUT extracted from Blender 3.6 OCIO "Filmic / Medium High Contrast")
379
+ - Inverted-hull screen-space outline pass on opaque + transparent
313
380
 
314
- - **Eye pipeline** stamps `stencil = EYE_VALUE` on every fragment it writes, with `cullMode: "front"` and a small negative `depthBias` so only the back half of the eye mesh renders (the MMD trick that keeps eyes from leaking through the back of the head).
315
- - **Main hair pipeline** stencil-tests `not-equal EYE_VALUE` and skips those fragments.
316
- - **Hair-over-eyes pipeline** re-issues the hair draws with `IS_OVER_EYES = true`, stencil-tests `equal EYE_VALUE`, disables depth writes, and alpha blends at 50% — eye-stamped pixels end up `0.5·hair + 0.5·eye` in linear HDR before tonemap.
317
- - **Outline pipeline** stencil-tests `not-equal EYE_VALUE` so edge color does not overwrite the see-through region.
381
+ **Alpha-hashed transparency** (`stockings` only) Wyman & McGuire 2017 derivative-aware stochastic discard with world-space hash, so self-overlapping transparent meshes resolve under MSAA with opaque-style depth writes and the dither doesn't swim with the camera.
318
382
 
319
- Draw order within a model: non-eye/non-hair opaque eye (stamp) hair (skip stamp) outlines (skip stamp) → hair-over-eyes (match stamp).
383
+ **See-through hair over eyes** (MMD post-alpha-eye) — single stencil-gated extra pass: eye stamps `EYE_VALUE`, main hair skips it, an extra hair-over-eyes pass matches it and alpha-blends at 25% in linear HDR before tonemap. Outline pass also skips the stamp so the iris stays readable.
320
384
 
321
385
  ## Projects Using This Engine
322
386
 
package/dist/camera.d.ts CHANGED
@@ -9,6 +9,7 @@ export declare class Camera {
9
9
  near: number;
10
10
  far: number;
11
11
  private canvas;
12
+ private inputLocked;
12
13
  private isDragging;
13
14
  private mouseButton;
14
15
  private lastMousePos;
@@ -36,6 +37,7 @@ export declare class Camera {
36
37
  getProjectionMatrix(): Mat4;
37
38
  attachControl(canvas: HTMLCanvasElement): void;
38
39
  detachControl(): void;
40
+ setInputLocked(locked: boolean): void;
39
41
  private onMouseDown;
40
42
  private onMouseMove;
41
43
  private onMouseUp;
@@ -1 +1 @@
1
- {"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../src/camera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAMnC,qBAAa,MAAM;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,IAAI,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAI;IAClB,IAAI,EAAE,MAAM,CAAO;IACnB,GAAG,EAAE,MAAM,CAAU;IAGrB,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,iBAAiB,CAAY;IACrC,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,oBAAoB,CAAY;IAGxC,kBAAkB,EAAE,MAAM,CAAQ;IAClC,cAAc,EAAE,MAAM,CAAS;IAC/B,cAA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13
  this.isDragging = false;
13
14
  this.mouseButton = null; // Track which mouse button is pressed (0 = left, 2 = right)
14
15
  this.lastMousePos = { x: 0, y: 0 };
@@ -144,12 +145,24 @@ export class Camera {
144
145
  window.removeEventListener("touchend", this.onTouchEnd);
145
146
  this.canvas = null;
146
147
  }
148
+ setInputLocked(locked) {
149
+ this.inputLocked = locked;
150
+ if (locked) {
151
+ this.isDragging = false;
152
+ this.isPinching = false;
153
+ this.touchIdentifier = null;
154
+ }
155
+ }
147
156
  onMouseDown(e) {
157
+ if (this.inputLocked)
158
+ return;
148
159
  this.isDragging = true;
149
160
  this.mouseButton = e.button;
150
161
  this.lastMousePos = { x: e.clientX, y: e.clientY };
151
162
  }
152
163
  onMouseMove(e) {
164
+ if (this.inputLocked)
165
+ return;
153
166
  if (!this.isDragging)
154
167
  return;
155
168
  const deltaX = e.clientX - this.lastMousePos.x;
@@ -183,6 +196,8 @@ export class Camera {
183
196
  e.preventDefault();
184
197
  }
185
198
  onTouchStart(e) {
199
+ if (this.inputLocked)
200
+ return;
186
201
  e.preventDefault();
187
202
  if (e.touches.length === 1) {
188
203
  // Single touch - rotation
@@ -210,6 +225,8 @@ export class Camera {
210
225
  }
211
226
  }
212
227
  onTouchMove(e) {
228
+ if (this.inputLocked)
229
+ return;
213
230
  e.preventDefault();
214
231
  if (this.isPinching && e.touches.length === 2) {
215
232
  // Two-finger gesture: can be pinch zoom or pan
package/dist/engine.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- import { Vec3 } from "./math";
1
+ import { Quat, Vec3 } from "./math";
2
2
  import { Model } from "./model";
3
- import { type PhysicsOptions } from "./physics";
4
3
  import { type AssetReader } from "./asset-reader";
5
4
  export type MaterialPreset = "default" | "face" | "hair" | "body" | "eye" | "stockings" | "metal" | "cloth_smooth" | "cloth_rough";
6
5
  export type MaterialPresetMap = Partial<Record<MaterialPreset, string[]>>;
7
- export type RaycastCallback = (modelName: string, material: string | null, screenX: number, screenY: number) => void;
6
+ export type RaycastCallback = (modelName: string, material: string | null, bone: string | null, screenX: number, screenY: number) => void;
8
7
  /** Select a folder (webkitdirectory) and pass FileList or File[]; pmxFile picks which .pmx when several exist. */
9
8
  export type LoadModelFromFilesOptions = {
10
9
  files: FileList | File[];
@@ -52,6 +51,30 @@ export type ViewTransformOptions = {
52
51
  look: "default" | "medium_high_contrast";
53
52
  };
54
53
  export declare const DEFAULT_VIEW_TRANSFORM: ViewTransformOptions;
54
+ export type GizmoDragKind = "rotate" | "translate";
55
+ export interface GizmoDragEvent {
56
+ modelName: string;
57
+ boneName: string;
58
+ boneIndex: number;
59
+ kind: GizmoDragKind;
60
+ /** Computed target local rotation (for "rotate") / target local translation (for "translate"). */
61
+ localRotation: Quat;
62
+ localTranslation: Vec3;
63
+ /** Drag start (mousedown) or end (mouseup). Undefined during drag moves. */
64
+ phase?: "start" | "end";
65
+ }
66
+ /**
67
+ * Gizmo drag callback. The engine does NOT write to the skeleton on its own —
68
+ * it only computes the target local rotation / translation for the dragged bone
69
+ * and fires this callback. The host decides how to apply it (e.g. call
70
+ * `model.setBoneLocalRotation(boneIndex, localRotation)` for a runtime-only
71
+ * edit, call `rotateBones({ [boneName]: localRotation }, 0)` for a tweened
72
+ * write, or mutate an animation clip keyframe and re-seek).
73
+ *
74
+ * Fires once with phase="start" on mousedown, on every mousemove (no phase),
75
+ * and once with phase="end" on mouseup.
76
+ */
77
+ export type GizmoDragCallback = (event: GizmoDragEvent) => void;
55
78
  export type EngineOptions = {
56
79
  world?: WorldOptions;
57
80
  sun?: SunOptions;
@@ -61,7 +84,8 @@ export type EngineOptions = {
61
84
  /** View transform (exposure/gamma) applied in composite before/after Filmic. */
62
85
  view?: Partial<ViewTransformOptions>;
63
86
  onRaycast?: RaycastCallback;
64
- physicsOptions?: PhysicsOptions;
87
+ /** See {@link GizmoDragCallback}. */
88
+ onGizmoDrag?: GizmoDragCallback;
65
89
  };
66
90
  export declare const DEFAULT_ENGINE_OPTIONS: {
67
91
  world: {
@@ -79,9 +103,6 @@ export declare const DEFAULT_ENGINE_OPTIONS: {
79
103
  fov: number;
80
104
  };
81
105
  onRaycast: undefined;
82
- physicsOptions: {
83
- constraintSolverKeywords: string[];
84
- };
85
106
  };
86
107
  export interface EngineStats {
87
108
  fps: number;
@@ -118,6 +139,32 @@ export declare class Engine {
118
139
  private groundShadowPipeline;
119
140
  private groundShadowBindGroupLayout;
120
141
  private outlinePipeline;
142
+ private selectedMaterial;
143
+ private selectionMaskTexture?;
144
+ private selectionMaskView?;
145
+ private selectionMaskPipeline;
146
+ private selectionMaskPassDescriptor;
147
+ private selectionEdgePipeline;
148
+ private selectionEdgeBindGroupLayout;
149
+ private selectionEdgeBindGroup?;
150
+ private selectionEdgeUniformBuffer;
151
+ private selectionEdgePassDescriptor;
152
+ private selectionSampler;
153
+ private selectedBone;
154
+ private gizmoVertexBuffer;
155
+ private gizmoTransformBuffer;
156
+ private gizmoPipeline;
157
+ private gizmoBindGroup0;
158
+ private gizmoColorBindGroups;
159
+ private gizmoPassDescriptor;
160
+ private static readonly GIZMO_RING_SEGMENTS;
161
+ private static readonly GIZMO_RING_RADIUS;
162
+ private static readonly GIZMO_AXIS_LENGTH;
163
+ private gizmoDraws;
164
+ private static readonly GIZMO_WORLD_SIZE;
165
+ private static readonly GIZMO_THICKNESS_PX;
166
+ private static readonly GIZMO_PICK_THRESHOLD_PX;
167
+ private gizmoDrag;
121
168
  private mainPerFrameBindGroupLayout;
122
169
  private mainPerInstanceBindGroupLayout;
123
170
  private mainPerMaterialBindGroupLayout;
@@ -190,7 +237,7 @@ export declare class Engine {
190
237
  private groundShadowMaterialBuffer?;
191
238
  private groundDrawCall;
192
239
  private onRaycast?;
193
- private physicsOptions;
240
+ private onGizmoDrag?;
194
241
  private lastTouchTime;
195
242
  private readonly DOUBLE_TAP_DELAY;
196
243
  private pickPipeline;
@@ -242,6 +289,7 @@ export declare class Engine {
242
289
  private createPipelines;
243
290
  private setupResize;
244
291
  private handleResize;
292
+ private setupGizmo;
245
293
  private setupCamera;
246
294
  /** Set static camera look-at / orbit center. Clears any model follow binding. */
247
295
  setCameraTarget(v: Vec3): void;
@@ -303,6 +351,8 @@ export declare class Engine {
303
351
  getModelNames(): string[];
304
352
  getModel(name: string): Model | null;
305
353
  markVertexBufferDirty(modelNameOrModel?: string | Model): void;
354
+ setSelectedMaterial(modelName: string | null, materialName: string | null): void;
355
+ setSelectedBone(modelName: string | null, boneName: string | null): void;
306
356
  setMaterialPresets(modelName: string, presets: MaterialPresetMap): void;
307
357
  setMaterialVisible(modelName: string, materialName: string, visible: boolean): void;
308
358
  toggleMaterialVisible(modelName: string, materialName: string): void;
@@ -330,6 +380,19 @@ export declare class Engine {
330
380
  private handleCanvasDoubleClick;
331
381
  private handleCanvasTouch;
332
382
  private performRaycast;
383
+ private renderSelectionPasses;
384
+ private renderGizmoPass;
385
+ private rotateVec3ByQuat;
386
+ private unproject;
387
+ private buildMouseRay;
388
+ private hitTestGizmo;
389
+ private distSegmentRay;
390
+ private closestParamOnAxisLine;
391
+ private rayPlane;
392
+ private angleInRingPlane;
393
+ private handleGizmoMouseDown;
394
+ private handleGizmoMouseMove;
395
+ private handleGizmoMouseUp;
333
396
  private renderPickPass;
334
397
  private resolvePickResult;
335
398
  render(): void;
@@ -359,7 +422,7 @@ export declare class Engine {
359
422
  /**
360
423
  * Second hair pass for the see-through-hair effect. Re-draws every hair opaque
361
424
  * draw using `hairOverEyesPipeline` — which stencil-matches `EYE_VALUE` and runs
362
- * the hair shader with `IS_OVER_EYES=true` so alpha is halved. depthWriteEnabled
425
+ * the hair shader with `IS_OVER_EYES=true` so alpha is scaled to 25%. depthWriteEnabled
363
426
  * is off, so the eye's depth stays authoritative for anything drawn after.
364
427
  */
365
428
  private drawHairOverEyes;
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,IAAI,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,KAAK,EA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