Gnetum
一款 Minecraft 模组,通过将 HUD 更新分散到多帧中来提升性能。
概述
Gnetum 将完整的 HUD 更新划分为多个“阶段”。每帧仅渲染一个阶段,从而减少 HUD 更新的耗时并提高 FPS。
根据每个元素的渲染时间,Gnetum 会自动将其更新分配到多帧中,从而同时提升平均 FPS 和最低 FPS。
技术说明
Gnetum 的设计思路是降低 HUD 的帧率。由于 HUD 渲染成本较高且变化并不频繁,降低其帧率可以在不牺牲整体游戏体验的前提下改善游戏性能,同时提升平均 FPS 和最低 FPS。具体实现方式如下:
- Gnetum 使用两个帧缓冲区,分别称为后帧缓冲区(back framebuffer)和前帧缓冲区(front framebuffer)
- 每一帧会渲染一个“阶段”,即完整 HUD 的一部分(可自定义),写入后帧缓冲区
- 例如,如果将阶段数设置为 4,则一次完整的 HUD 更新将被分散到 4 帧中完成,从而大幅减少每帧的绘制调用次数并提升 FPS
- 所有阶段渲染完成后,后帧缓冲区会与前端帧缓冲区进行“交换”
- 每帧还会渲染前帧缓冲区,其中包含完整 HUD 的纹理
此外,还有一个 HUD FPS 限制器,用于定义 HUD 的最大帧率。
配置
从 4.0.0 版本开始,支持与 Sodium Config API 集成。可通过视频设置界面访问配置,调整以下选项:
- 阶段数量
- HUD 最大帧率
- 为各个元素启用/禁用缓存
兼容性
1.20.1、1.21.1 与 1.21.11
✔️ ImmediatelyFast:完全兼容,推荐使用。
1.12.2
⚠️ OptiFine:请确保禁用“快速渲染”(否则本模组将不起作用。)
⚠️ StellarCore:请确保禁用其 HUD 缓存功能(如果你不确定如何禁用,可以忽略此项:默认情况下该功能已禁用。)
鸣谢
本模组灵感来源于 Moulberry 开发的 HUDCaching 模组。
Gnetum
A Minecraft mod that improves performance by distributing HUD updates over multiple frames.
Overview
Gnetum divides a full HUD update into multiple "passes." Only one pass is rendered each frame, reducing the time taken on HUD updates and improving FPS.
Based on the rendering time of each element, Gnetum automatically distributes their updates over multiple frames, improving both the average FPS and the minimum.
Technical explanations
The idea behind Gnetum is to reduce the framerate of the HUD, which is not cheap to render and does not really change often, to improve the overall performance of the game, in a way that improves both the average and the minimum FPS. To achieve this:
- Gnetum employs two framebuffers, called a back framebuffer and a front framebuffer, respectively
- Each frame will render a "pass", that is, a (customizable) portion of the complete HUD, to the back framebuffer
- If the number of passes is set to 4, for example, a full HUD update is distributed over 4 frames, saving a lot of draw calls every frame and improving FPS
- After all passes finish rendering, the back framebuffer is "swapped" with the front framebuffer
- Each frame also renders the front framebuffer, which contains a texture of the full HUD
There is also an HUD FPS limiter that defines the maximum FPS of the HUD.
Configuration
Starting from 4.0.0, integration is implemented with Sodium Config API. The configuration can be accessed from the Video Screen, allowing for adjustment of:
- the number of passes
- maximum HUD FPS
- enabling/disabling caching for each element
Compatibility
1.20.1, 1.21.1 & 1.21.11
✔️ ImmediatelyFast: fully compatible and recommended.
1.12.2
⚠️ OptiFine: make sure "Fast Render" is disabled (this mod would do nothing otherwise.)
⚠️ StellarCore: make sure their HUD Caching feature is disabled (if you are unsure how to disable it you can ignore this: it's disabled by default.)
Credits
This mod is inspired by the HUDCaching mod by Moulberry.
评论 0
登录后参与评分
还没有评论,来抢沙发吧