弃用通知:
本模组将不再更新到更高版本。Sodium 已将其类似的优化实现到了 Seaborgium 的修复方案中,并整合进了它们自己的模组里。此外,我也缺乏时间来维护此模组。代码采用 ISC 许可证授权,您可以自由地进行任何您希望的修改和使用。
因此,我将在此 GitHub 上归档该模组,并在 Modrinth 上重新建立公开存档以供查阅。
1.19.4 注意事项:Iris 做出了破坏性更改,导致此模组与之不兼容。
如果有开发者有理由在 1.19.4 中使用此模组,要使其兼容,除了更新依赖项外,只需在 MixinPipelineManager 中将 net.coderbot.iris.shaderpack.DimensionId 替换为 net.coderbot.iris.shaderpack.materialmap.NamespacedId 即可。
Seaborgium 是什么?
Seaborgium 是一款免费且开源的 Minecraft 优化模组。它通过实现其他模组所忽略的优化措施,提升了游戏的渲染性能。
Seaborgium 提供了一个统一的 jar 包,这意味着它同时包含了类 Fabric 和类 Forge 版本的模组内容。
优化措施
Seaborgium 实现了一个简单的缓存机制,用于存储每个着色器程序中统一变量(uniform variables)的位置。
当 GLStateManager 首次调用 glGetUniformLocation 时,Seaborgium 会检查是否已缓存了所请求统一变量的位置。
如果存在缓存,则直接返回缓存的位置而无需再次调用 glGetUniformLocation。
如果不存在缓存,则调用 glGetUniformLocation 并将结果存入缓存以便后续使用。
此优化减少了 OpenGL 调用的次数,并避免了不必要的开销。
已知 glGetUniformLocation 的调用速度相当缓慢,驱动程序花费明显的 CPU 时间来处理此函数并不罕见。
通过缓存该函数的结果,Seaborgium 能够避免浪费 CPU 周期去等待一个我们本应已有数据的函数返回值。
我应该期待什么样的性能提升?
性能提升因场景而异,差异可能很大。文中讨论的性能数据基于我个人的机器配置,包括 AMD Ryzen 5 5600x、32GB DDR4 @ 3200Mhz 以及 Nvidia GTX 980ti。所有测试均包含常见的优化模组 Lithium 和 Sodium。
由于 Minecraft 渲染生命值心的方式,大量爱心会迅速变得昂贵(消耗性能)。在吸收值(absorption)为 255 的情况下,此模组能够将平均帧率从令人痛苦的 53 提升至较为可观的 163。
在常规游戏场景中,结果依然明显但没那么显著。启用后,帧率比未启用时提高了约 30 到 50 FPS。
兼容性
Seaborgium 与您预期的所有模组都兼容,包括 Sodium/Rubidium、Canary/Lithium、Starlight 等等!
除了那些改变后端图形 API 的模组(例如 Vulkan Mod)之外,目前没有其他已知的不兼容问题。如果您发现任何问题,请在问题页面上报告!
DEPRECATION NOTICE:
This mod will not receive updates to later versions. Sodium has implemented a similar optimization to Seaborgium's fix into their mods. I also do lack the time to maintain this mod. The code is licensed under the ISC license, and you are free to make any modifications you wish to use.
I am henceforth archiving the mod on github, and re-establishing it as public for on modrinth for archival purposes.
1.19.4 Notice: Iris made a breaking change, making this making this mod incompatible.
If any developer has a reason to use this mod on 1.19.4, to make it compatible all you need to do is (aside from updating dependencies) is replace net.coderbot.iris.shaderpack.DimensionId with net.coderbot.iris.shaderpack.materialmap.NamespacedId in MixinPipelineManager
What is Seaborgium?
Seaborgium is a free and open source optimization mod for Minecraft. It improves the rendering performance of the game by implementing optimizations that are overlooked by other mods.
Seaborgium provides a unified jar, which means it contains both the Fabric-like and Forge versions of the mod.
Optimizations
Seaborgium implements a simple cache that stores the locations of uniform variables for each shader program.
When GLStateManager invokes glGetUniformLocation for the first time, Seaborgium checks if it has a cached location for the requested uniform.
If it does, it returns the cached location without invoking glGetUniformLocation.
If it does not, it invokes glGetUniformLocation and stores the result in the cache for future use.
This optimization reduces the number of OpenGL calls and avoids unnecessary overhead.
Invoking glGetUniformLocation is known to be quite slow, and it is not uncommon for drivers to consume noticeable CPU time to process this function.
By caching the result of this function, Seaborgium is able to avoid wasting CPU cycles waiting for a function to return data we should already have on hand.
What sort of performance gains should I expect?
The performance gains can vary significantly by scenario. The performance numbers discussed are based off my personal machine, which has an AMD Ryzen 5 5600x, 32GB DDR4 @ 3200Mhz, and an Nvidia GTX 980ti. All tests also include common optimization mods Lithium and Sodium.
Because of how Minecraft renders hearts to the screen, having a significant number of them quickly becomes expensive. With absorption 255, this mod able to increase the frame rate from a painful 53 average to fairly respectable 163 average.
In a regular gameplay scenario, the results were still noticeable but less pronounced. Enabling between a 30 and 50 FPS increase over what it would be without.
Compatibility
Seaborgium is compatible with all of your expected mods, Sodium/Rubidium, Canary/Lithium, Starlight, and more!
Outside of mods that change the backend graphics API (such as Vulkan Mod) there are no currently known incompatibilities. If you discover any, please report them on the issues page!
评论 0
登录后参与评分
还没有评论,来抢沙发吧