BadOptimizations
一系列主要由微优化组成的模组,积少成多!
它做了什么?
多项功能:
- 避免更新光照贴图
更新光照贴图纹理是客户端 Tick 中最耗时的部分之一。在每个 Tick 期间,客户端会执行向量数学计算来为方块和天空生成光照贴图,然后将新的纹理上传至 GPU。然而,如果没有任何影响方块亮度的因素发生变化,这些计算完全可以被避免并缓存。本模组会在未改变方块亮度的因素(例如伽马值滑块、药水效果、维度)没有变化时,取消光照贴图的更新。
- 无需调试逻辑时不执行
Minecraft 拥有四种可通过调试服务器激活的调试渲染器:蜜蜂、游戏事件、游戏测试和村民 AI。即使没有需要处理的内容,这些调试渲染器的逻辑代码仍然会被执行。本模组仅在启用调试模式且服务器有数据需要处理时才执行这些逻辑。
- 天空颜色计算优化(适用于 1.21.10 及更低版本)
Minecraft 每帧都会使用立方体颜色采样器来计算当前的天空颜色。该函数会循环 216 次以考虑周围生物群系的影响,即使所有相邻生物群系完全相同或具有相同的天空颜色也是如此。本模组确保仅在你处于具有不同天空颜色的生物群系之间时才使用颜色采样器,并为每个 Tick 进行缓存。否则,将使用更短、更简单且更快的天空颜色计算方式。
以上仅是其中一部分。
如果需要,你可以在配置文件中禁用任何优化项。
它能带来多少提升?
这取决于你的系统和运气,但在我的电脑上(RTX 3060,Intel i7 12700,在 Fabulously Optimized 整合包中分配了 4GB 内存):
在不显示提示框的情况下,帧率从 1926-1955 FPS 提升至:

2008-2023 FPS:

在显示提示框的情况下,帧率从 1351-1384 FPS 提升至 1414-1458 FPS:


我的模组不兼容!
你可以 标记你的模组与特定的 BadOptimizations 选项不兼容。如果你的模组存在,BadOptimizations 会自动禁用你指定的特定选项。
你也可以添加 钩子以告知 BadOptimizations 何时需要更新光照贴图或天空颜色,而不是直接添加硬性不兼容设置到缓存优化中。
依赖项?
无。
(如果你更喜欢 CurseForge,也可以在 CurseForge 上找到它。)
BadOptimizations
A collection of mostly micro optimizations that add up to something bigger!
What does it do?
Multiple things:
- Avoid updating lightmap
Updating lightmap textures are one of the most expensive parts of the client tick. During each tick, the client will do vector math to calculate lightmaps for blocks and the sky, then upload that new texture to the GPU. However, this can be completely avoided and cached if nothing affecting block brightness has changed. This mod will cancel lightmap updates if nothing that changes block brightness (e.g. gamma slider, potion effects, dimension) has changed.
- Don't do debug logic if we don't need to
Minecraft has four debug renderers that can be activated with a debug server: bees, game events, game test and villager AI. Even if there's nothing to process, the logic for these debug renderers are still executed. This mod will only execute them if debug is enabled and there is data from the server to process.
- Sky color calculation optimizations (1.21.10 and below)
Minecraft uses a cubic color sampler every frame to calculate the current sky color. This function loops 216 times to factor in surrounding biomes, even if all surrounding biomes are identical or have identical sky colors. This mod makes the color sampler only used if you are between biomes with different sky colors, and caches it for each tick. Otherwise, a shorter, simpler and faster sky color calculation is used.
That's a few of them, at least.
You can disable any optimization in the config file if you need to.
How much does it help?
Depends on your system and luck, but on my own PC, an RTX 3060, intel i7 12700 and 4GB of allocated ram on Fabulously Optimized:
Without toasts, it goes from 1926-1955 FPS:

To 2008-2023 FPS:

And with toasts, it goes from 1351-1384 FPS:

To 1414-1458 FPS:

My mod is incompatible!
You can mark your mod as incompatible with specific BadOptimizations options. If your mod is present, BadOptimizations will automatically disable the specific options you specify.
You can also add hooks that tell BadOptimizations when the lightmap or sky color needs to be updated instead of adding a hard incompatibility to the caching optimizations.
Dependencies?
None.
(Also available on CurseForge, if that's your thing.)
评论 0
登录后参与评分
还没有评论,来抢沙发吧