Look panel: outlines, shadows, cel/studio shading, rim light #9

Merged
dev merged 4 commits from devin/1796104981-shaders into main 2026-12-01 01:31:16 -05:00
Owner

Adds a Look panel with scene-wide visual effects, saved in .mrscene and used in final renders.

  • Edge outlines: MMD-style ink lines per material, using each PMX/PMD material's edge flag, colour and size plus PMX per-vertex edge scale. Drawn as an inverted-hull pass that shares the skinning code, so CPU and GPU skinning both work.
  • Shadows: depth-map shadows (1024/2048/4096) with 12-tap soft filtering, self-shadowing, shadows on stages, and a shadow-only floor when no stage is visible. PMX cast/receive flags are respected. Stages receive shadows; Stages cast shadows (off by default) adds tree/building shadows at extra cost. Outlines never enter the shadow pass, and the lookup stops after 4 taps outside penumbras. Disabled automatically when the GPU lacks depth textures/FBOs.
  • Material styles: MMD toon, Lambert, anime cel, soft studio, plus optional rim light.
  • Light: colour, azimuth/elevation, or follow camera. Presets: MMD classic, Anime, Studio.
  • CLI: --shading toon|lambert|cel|soft, --shadows on|off, --outlines on|off, --rim S.

Shaders stay GLSL 1.20 for macOS legacy OpenGL. Scene files without a look object load with defaults.

Tested: build + mr_tests on Linux and macOS 12; screenshots of all styles, outlines on/off, WinterWorld stage shadows, and a 3-frame render on Linux; Karin with all styles and WinterWorld on the Mac. Mac (Intel HD 6000, Karin + WinterWorld): shadows + outlines cost about 4–10 ms per frame. Not tested: pop-out/dock with the new shadow pass, Windows build.

Adds a **Look** panel with scene-wide visual effects, saved in `.mrscene` and used in final renders. - **Edge outlines**: MMD-style ink lines per material, using each PMX/PMD material's edge flag, colour and size plus PMX per-vertex edge scale. Drawn as an inverted-hull pass that shares the skinning code, so CPU and GPU skinning both work. - **Shadows**: depth-map shadows (1024/2048/4096) with 12-tap soft filtering, self-shadowing, shadows on stages, and a shadow-only floor when no stage is visible. PMX cast/receive flags are respected. Stages receive shadows; **Stages cast shadows** (off by default) adds tree/building shadows at extra cost. Outlines never enter the shadow pass, and the lookup stops after 4 taps outside penumbras. Disabled automatically when the GPU lacks depth textures/FBOs. - **Material styles**: MMD toon, Lambert, anime cel, soft studio, plus optional rim light. - **Light**: colour, azimuth/elevation, or follow camera. Presets: MMD classic, Anime, Studio. - **CLI**: `--shading toon|lambert|cel|soft`, `--shadows on|off`, `--outlines on|off`, `--rim S`. Shaders stay GLSL 1.20 for macOS legacy OpenGL. Scene files without a `look` object load with defaults. Tested: build + `mr_tests` on Linux and macOS 12; screenshots of all styles, outlines on/off, WinterWorld stage shadows, and a 3-frame render on Linux; Karin with all styles and WinterWorld on the Mac. Mac (Intel HD 6000, Karin + WinterWorld): shadows + outlines cost about 4–10 ms per frame. Not tested: pop-out/dock with the new shadow pass, Windows build.
dev added 1 commit 2026-12-01 01:14:30 -05:00
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dev added 1 commit 2026-12-01 01:16:56 -05:00
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dev added 1 commit 2026-12-01 01:19:39 -05:00
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dev added 1 commit 2026-12-01 01:22:02 -05:00
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dev merged commit fd6f56826e into main 2026-12-01 01:31:16 -05:00
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#9