Artemking4 argues Mesh:DrawSkinned should allow bone 0

In #next-update, Artemking4 said IMesh:DrawSkinned can't use all 53 matrices: it's off by one and wrongly errors on the last bone. Rubat replied that matrix 0 is reserved by the engine as far as he remembers, so DrawSkinned gets 1–52. In his tests, setting matrix 0 did nothing or caused issues. Artemking4 disagreed: bone 0 is a normal bone that also serves as the model matrix for unskinned vertices, and his patched client.dll renders models almost perfectly with it.

Updates

  • : Commit 291b48 fixed the wrongful error with 52 bones.
  • : Rubat asked Artemking4 for code that reproduces the problem.
  • : Artemking4 posted a minimal repro; with bone 0 and a model matrix push/pop he reports full parity with engine MDL rendering.
  • : Artemking4 opened garrysmod-issues #7119: bone 0 is also loaded as the model matrix in shaderapidx8.cpp, and wrapping the call in cam.PushModelMatrix fixes the rendering.
4 updates