OSG + Assimp + ImGui model renderer: PMX/PMD/FBX, bone posing, morph sliders #1

Open
dev wants to merge 3 commits from devin/1795773104-osg-model-renderer into main
pull from: devin/1795773104-osg-model-renderer
Owner

Initial implementation of the cross-platform model viewer (OpenSceneGraph + Assimp + Dear ImGui).

  • src/model: one internal mr::Model; custom PmxLoader / PmdLoader (Assimp can't read PMD and drops PMX morphs); AssimpLoader for FBX; Poser does CPU morphs (vertex/group/bone/flip) + linear blend skinning. Bone poses are in model-space axes at the bone pivot so MMD and FBX rigs behave the same.
  • src/render: ModelNode (per-material OSG geometry, GLSL 1.20 shaders for macOS legacy GL), textures incl. sphere/toon maps.
  • src/ui + src/app: ImGui overlay rendered from the camera final-draw callback (Model / Bones / Morphs panels, file browser, view options), CJK font auto-detection, CLI for scripted screenshots.
  • tests: loader + posing tests on generated PMX/PMD/FBX fixtures (tools/).
  • README: build steps for macOS (Homebrew), Linux (apt/dnf) and Windows (vcpkg).

Verified on Linux (Mesa llvmpipe): ctest passes; rendered miku_v2.pmd, Mixamo FBX and the test FBX with poses and morphs. Not yet built on macOS/Windows. Not implemented: IK, physics, UV/material morphs, edge outlines, VMD playback.

Written by Devin

Initial implementation of the cross-platform model viewer (OpenSceneGraph + Assimp + Dear ImGui). - `src/model`: one internal `mr::Model`; custom `PmxLoader` / `PmdLoader` (Assimp can't read PMD and drops PMX morphs); `AssimpLoader` for FBX; `Poser` does CPU morphs (vertex/group/bone/flip) + linear blend skinning. Bone poses are in model-space axes at the bone pivot so MMD and FBX rigs behave the same. - `src/render`: `ModelNode` (per-material OSG geometry, GLSL 1.20 shaders for macOS legacy GL), textures incl. sphere/toon maps. - `src/ui` + `src/app`: ImGui overlay rendered from the camera final-draw callback (Model / Bones / Morphs panels, file browser, view options), CJK font auto-detection, CLI for scripted screenshots. - `tests`: loader + posing tests on generated PMX/PMD/FBX fixtures (`tools/`). - README: build steps for macOS (Homebrew), Linux (apt/dnf) and Windows (vcpkg). Verified on Linux (Mesa llvmpipe): `ctest` passes; rendered miku_v2.pmd, Mixamo FBX and the test FBX with poses and morphs. Not yet built on macOS/Windows. Not implemented: IK, physics, UV/material morphs, edge outlines, VMD playback. [Written by Devin](https://app.devin.ai/sessions/edc92906d52f4fb09179a164d60f5f27)
dev added 1 commit 2026-11-27 04:51:47 -05:00
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dev added 1 commit 2026-11-27 04:53:34 -05:00
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dev added 1 commit 2026-11-27 05:05:39 -05:00
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
Owner
Desktop QA: posing and morphs

Miku opened from the empty viewer with readable Japanese labels. Arm and head slider drags deformed the intended parts without moving the camera, and both pose resets restored the rest view. Blink and mouth morphs combined at full weight and reset to neutral.

Miku before and after applying blink and mouth morphs

Miku left-arm and head poses captured during slider drags

View controls, FBX replacement, and recovery

Skeleton highlighting, wireframe, culling, shading, and panel-scroll isolation behaved as expected. Mixamo replaced Miku, selected Lambert shading by default, and responded to model-space rotations. A junk PMX produced a dismissible error without losing the current FBX pose.

Mixamo posing and recovery from an invalid PMX

Issues found and fixed in d4c34f8: a previous model's filter query left the next model's Bones list blank with no hint, and pasting 左腕 into the Bones filter inserted nothing on Linux. Filters now clear on model load and show a "no match" hint; clipboard uses the system clipboard (xclip/xsel/wl-clipboard on Linux, native on macOS/Windows), and typed non-ASCII characters are accepted. Verified by pasting 左腕 into the Bones filter. Native IME input not tested.

Written by Devin

<details open> <summary>Desktop QA: posing and morphs</summary> Miku opened from the empty viewer with readable Japanese labels. Arm and head slider drags deformed the intended parts without moving the camera, and both pose resets restored the rest view. Blink and mouth morphs combined at full weight and reset to neutral. ![Miku before and after applying blink and mouth morphs](/attachments/48da38ab-ed6f-4b5a-b877-c43c502d718a) ![Miku left-arm and head poses captured during slider drags](/attachments/bf9d2ed8-b83a-4e92-b250-e7d0c50d2de0) </details> <details> <summary>View controls, FBX replacement, and recovery</summary> Skeleton highlighting, wireframe, culling, shading, and panel-scroll isolation behaved as expected. Mixamo replaced Miku, selected Lambert shading by default, and responded to model-space rotations. A junk PMX produced a dismissible error without losing the current FBX pose. ![Mixamo posing and recovery from an invalid PMX](/attachments/ba756acd-5eae-4a98-8658-46560e2210aa) </details> **Issues found and fixed in d4c34f8:** a previous model's filter query left the next model's Bones list blank with no hint, and pasting `左腕` into the Bones filter inserted nothing on Linux. Filters now clear on model load and show a "no match" hint; clipboard uses the system clipboard (xclip/xsel/wl-clipboard on Linux, native on macOS/Windows), and typed non-ASCII characters are accepted. Verified by pasting `左腕` into the Bones filter. Native IME input not tested. [Written by Devin](https://app.devin.ai/sessions/edc92906d52f4fb09179a164d60f5f27)
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin devin/1795773104-osg-model-renderer:devin/1795773104-osg-model-renderer
git checkout devin/1795773104-osg-model-renderer
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dev/3d-model-renderer#1