概述
VMD Animation Cache(VMD 动画缓存)消除了 SlashBlade Resharped 中冗余的 MMD 动作计算,当 SlashBlade 实体出现在屏幕上时,可带来 约 3.8 倍的 FPS 提升(50 → 190 FPS)。
当 SlashBlade 渲染基于 MMD 的剑刃动画时,VmdAnimation.setupAnim() 会被调用 每个实体每帧 60–120 次 —— 每次查询变换时针对每个骨骼各调用一次。但在单帧内,tick 和 partialTick 的值不会改变。所有 120 次调用都会产生相同的结果,浪费了渲染线程约 20% 的性能。
本模组添加了一个极小的每帧缓存:如果以相同的 tick 和 partialTick 再次调用 setupAnim,则跳过整个 MMD 管线。每个实体每帧从 120 次调用减少到 1 次。
性能表现
| 场景 | 优化前 | 优化后 |
| 第三人称视角 FPS(可见 SlashBlade) | ~50 | ~190 |
测试环境:Minecraft 1.20.1,Forge 47,SlashBlade Resharped 1.9.65。视野内单个 SlashBlade 实体。
前置要求
安装方法
- 下载 jar 文件并将其放入你的
mods/ 文件夹
- 启动游戏
兼容性
请勿与 AntiEntropyCore 同时使用 —— 两者都会注入同一个 Mixin 目标类(VmdAnimation),会导致冲突。
工作原理
单个 Mixin 在 VmdAnimation.setupAnim() 方法头部进行注入。它会记住上一次传入的 (currentTick, partialTick) 参数对。若命中缓存 → 取消该方法执行;若未命中 → 更新缓存并正常执行。
代码仅 32 行。仅限客户端运行。不涉及任何核心模组(coremod)黑客手段。
相关链接
Overview
VMD Animation Cache eliminates redundant MMD motion computation in SlashBlade Resharped, giving you ~3.8x FPS improvement (50 → 190 FPS) when SlashBlade entities are on screen.
When SlashBlade renders MMD-based blade animations, VmdAnimation.setupAnim() is called 60–120 times per entity per frame — once for every bone, every time a transform is queried. But the tick and partialTick don't change within a frame. All 120 calls produce identical results, wasting ~20% of the render thread.
This mod adds a tiny per-frame cache: if setupAnim is called again with the same tick and partialTick, the entire MMD pipeline is skipped. 120 calls → 1 call per entity per frame.
Performance
| Scenario | Before | After |
| Third-person FPS (SlashBlade visible) | ~50 | ~190 |
Tested on Minecraft 1.20.1, Forge 47, SlashBlade Resharped 1.9.65. Single SlashBlade entity in view.
Requirements
Installation
- Download the jar and drop it into your
mods/ folder
- Launch the game
Compatibility
Do not use with AntiEntropyCore — both mods inject into the same Mixin target (VmdAnimation) and will conflict.
How It Works
A single Mixin injects at the head of VmdAnimation.setupAnim(). It remembers the last (currentTick, partialTick) pair. Cache hit → method cancelled. Cache miss → update cache, run normally.
Only 32 lines of code. Client-side only. No coremod hacks.
Links
评论 0
登录后参与评分
还没有评论,来抢沙发吧