Fix cull mode + isolate head-collapse to a libgr2 curve bug

Rendering fixes (real):
- m2_material shaders: cull_disabled -> cull_back (inside-of-mesh faces were
  z-winning and darkening/hiding the head under the ShaderMaterial path).
- drop `* COLOR` from the shader (meshes carry no ARRAY_COLOR).

Animation: convert gr2 global poses to Godot *local* bone poses and set via
set_bone_pose (was set_bone_global_pose). MTGODOT_VERIFY=1 confirms
get_bone_global_pose(i) == conv(world[i]) for all 75 bones (<=2.6e-5).

Head/upper-armor collapse on dance_1 is NOT a Godot-route bug:
- reproduced identically in xrender-poc's bgfx demo at the same anim/t
- reproduced by the new MTGODOT_CPUSKIN=1 reference path (same LBS math as
  xrender's validated skin_mesh)
- `general/wait` / `run` render correctly in all three
=> upstream libgr2 Curve::eval (degree-2 quaternion B-spline) vs Granny.
Demo default animation switched to general/wait; documented in MIDREVIEW §4
and README. Debug scaffolding gated behind MTGODOT_VERIFY / MTGODOT_CPUSKIN.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WaHYEY9rwLWt21PULiYjeJ
This commit is contained in:
Claude
2026-08-29 10:47:01 +09:00
parent 30d6a81476
commit f4917a2b3b
15 changed files with 234 additions and 15 deletions
+5 -2
View File
@@ -26,8 +26,11 @@
`test/golden/m1-bindpose.png`)。多骨架:`warrior_lord`(v6,74)、`assassin`(v6,95,17 表面)、
`shaman_lord`(**v7**,93) 均正确加载渲染。
- [x] **M2** — 骨骼动画。`Metin2AnimPlayer` `_process``gr2::sample_pose`(跨文件)
`Skeleton3D.set_bone_global_pose`Godot GPU 蒙皮。`dance01`28.3s / 74 track
播放,`selfcheck` 25 采样 0 NaNt=2/9/16/23 姿势各异`test/golden/m2c-*.png`
逐骨 `Skeleton3D.set_bone_pose`(局部)Godot GPU 蒙皮。`general/wait` 头 / 护甲
对齐正确`test/golden/m2-wait.png``get_bone_global_pose` vs `conv(world)` 全骨 ≤2.6e-5
CPU-LBS 参考路径(`MTGODOT_CPUSKIN=1`)与 GPU 蒙皮一致;`selfcheck` 0 NaN。
⚠️ `dance_1` 等表情动作头 / 颈塌陷 —— **libgr2 曲线解码 bugxrender-poc bgfx demo 同样复现**
(见 `docs/MIDREVIEW.md` §4)。
- [~] **M2.5** — 材质与观感保真。`ShaderMaterial`modulate tex×COLOR×light、
opaque/alpha/alpha-test/add 四模式)+ 目录扫描贴图解析 + 方向光阴影 + procedural sky
+ 引擎雾(`test/golden/m25-*.png`)。**门禁未闭**:多材质槽 → 贴图/混合的精确映射需