适用于 Minecraft 原生 Vulkan 渲染器的 OptiFine 格式光影包
Minecraft 现已随附原生 Vulkan 渲染器,与原有的 OpenGL 渲染器并存。现有的所有光影包均为 OpenGL 编写,无法在 Vulkan 上运行。
Vitrail 仍能直接运行它们,无需修改。 它会从 shaderpacks/ 目录读取 OptiFine 格式的光影包,在加载时对其 GLSL 代码进行一次转换,然后交由游戏内置的编译器处理。绘制每一帧时不会进行任何实时转换。
这个项目最初源于一个疑问:过去十余年间为 OpenGL 编写的光影包,能否在当前游戏自带的渲染器上无缝运行?它作为一个人的业余项目,自七月起每日都在开发。随后有贡献者加入,目前仍处于早期阶段:其运行的后端被游戏本身标记为实验性功能。
它的构建方式符合当今许多软件的开发模式,否则可能根本不存在:AI 工具承担了大部分编码和调试工作,而人类开发者决定构建什么、使用真实光影包和 Iris 进行测试,并为每个错误承担责任。项目中从 Iris 和 Kroppeb 的 stareval 获取的代码已按文件在 NOTICE 文件中注明,并遵循相同的许可证。如果你在意这些细节,现在你知道了。如果这个模组有用,下方有咖啡赞助链接;问题反馈 是我回复的地方。
安装前须知:这是一个测试版
- Vulkan 后端是实验性的,由游戏本身标记:你需要开启的设置名为“优先 Vulkan(实验性)”。
- 整个场景都会经过你的光影包处理:地形、水面、阴影、天空、云层、天气、粒子、生物、方块实体、手持物品、名称标签和告示牌。目前仍由游戏引擎直接渲染的部分会在日志中首次绘制时显示引擎名称,且这一列表会随着版本发布逐渐缩短。
- 部分光影包在某些地方仍然显示不正确,错误的画面比缺失更糟。实际测试过的光影包表格 从你看到的现象开始,并说明了原因。
- 如果你今天想要的是完整的画面效果,请在 OpenGL 后端上使用 Iris。 它能很好地完成这项工作,并且是本引擎逐帧对比的参考标准。
自带光影包
Vitrail 是引擎,不是光影包本身,因此它不提供任何光影包:光影包属于其作者,其许可证不允许重新分发。以下是它能渲染的最知名光影包。
- Bliss
- BSL
- Complementary Reimagined
- Complementary Unbound
- Euphoria Patches
- I Like Vanilla
- Lux
- Mellow
- Photon
- Sildur's Vibrant
- Solas
- Spooklementary
- iterationT(仅在 Bilibili 上,不在 Modrinth 或 CurseForge 上)
实际测试过的光影包表格 中的其他所有光影包也能正常渲染,表格中还列出了每个光影包与 Iris 效果的接近程度。未列入表格的光影包表示我尚未加载过,而非不受支持。
安装后
- 将游戏切换至 Vulkan 并重启。 视频设置,“优先 Vulkan(实验性)”。后端在游戏启动时确定,因此需在下次启动时生效。
- 使用
I键选择你的光影包。 这将打开光影包选择界面,R键可从磁盘重新读取光影包,K键可关闭并重新开启光影。这三个按键均可在游戏的控制设置中 Vitrail 选项下进行重绑定。 - 如果帧率不足,有一个滑块可供调整。 视频设置,在 Vitrail 专属页面,“渲染比例”:场景以窗口大小的 25% 到 100% 进行渲染,并在界面之前恢复至全尺寸,因此无论比例如何,菜单、聊天和 F3 屏幕都保持清晰。
- Distant Horizons 兼容,你的光影包自带的 DH 程序会渲染其远景地形。在 Fabric 上,像安装其他模组一样安装即可。在 NeoForge 上,其当前正式版在 Vulkan 渲染器上仍会崩溃(由其自身的纹理解包器引起,非本模组),因此请手动安装 此构建版本。
- 不需要 Chloride,如果你运行它,其中有五项设置决定了哪些内容能传递给你的光影包:性能页面上的“快速箱子”和“快速床”,实体页面上的“最大实体距离”、“最大怪物距离”和“最大方块实体距离”。Vitrail 会在启动时的日志中列出任何检测到的相关设置。
仅客户端可用,提供一个 jar 文件,同时支持 Fabric 和 NeoForge。Iris 可与本模组共存,安装在 Iris 所需的 Sodium 版本上,Vitrail 同样运行于该版本之上:在 Vulkan 下 Vitrail 负责渲染,在 OpenGL 下 Iris 负责渲染,在视频设置中切换后端即切换引擎。 安装指南 包含其余信息。
链接与致谢
如果某个光影包或模组与 Vitrail 不兼容,请提交一个 问题反馈。 画面渲染错误、模组冲突、崩溃:每份报告都有帮助,如果你想参与贡献,非常欢迎提交拉取请求。
来源:今日整合包的内容、更新日志以及完整的兼容性说明均位于 Vitrail-Shaders。该光影也发布在 CurseForge 上。
采用 LGPL-3.0-only 许可证。整合包加载器与数值目录的部分代码改编自 Iris,后者同样采用 LGPL-3.0 许可证;表达式语法则基于 Kroppeb 的 stareval。具体哪些部分被借用以及在开发过程中进行了哪些修改,已在项目的 NOTICE 文件中逐文件记录。
OptiFine-format shader packs, on Minecraft's native Vulkan renderer
Minecraft now ships a native Vulkan renderer alongside the OpenGL one. Every shader pack that exists was written for OpenGL, and none of them run on it.
Vitrail runs them anyway, unmodified. It reads an OptiFine-format pack out
of shaderpacks/, translates its GLSL once when the pack loads, and hands it to
the compiler the game already embeds. Nothing translates while a frame is drawn.
It started as a question, whether packs written for OpenGL over more than a decade could run untouched on the renderer that now ships with the game, and as one person's side project, worked on every day since July. Contributors have joined along the way, and it is still an early one: the backend it runs on is marked experimental by the game itself.
It is built the way a lot of software gets built now, and it would not exist otherwise: AI tools do most of the typing and the debugging, and a human decides what gets built, tests it against real packs and against Iris, and carries the blame for every bug. What was taken from Iris and from Kroppeb's stareval is credited file by file in the project's NOTICE, under the same licence. If any of that matters to you, now you know. If the mod is useful, there is a coffee link below, and the issues are where I answer.
Before you install: it is a beta
- The Vulkan backend is experimental, marked so by the game itself: the setting you have to turn on reads "Prefer Vulkan (Experimental)".
- The world goes through your pack: terrain, water, shadows, sky, clouds, weather, particles, mobs, block entities, the held hand, name plates and signs. What still comes from the game, the engine names in its log when a place first draws, and that list shrinks release by release.
- Some packs still come out wrong in places, and a wrong picture is worse than a missing one. The table of packs actually tried starts from what you see and names the cause.
- If what you want today is a finished picture, use Iris on the OpenGL backend instead. It does that job well, and it is the reference this engine is checked against, frame against frame.
Bring your own pack
Vitrail is the engine, not the pack, and it can ship none: the packs belong to their authors and their licences do not allow redistribution. These are the best known of the packs it draws.
- Bliss
- BSL
- Complementary Reimagined
- Complementary Unbound
- Euphoria Patches
- I Like Vanilla
- Lux
- Mellow
- Photon
- Sildur's Vibrant
- Solas
- Spooklementary
- iterationT (on Bilibili, not on Modrinth or CurseForge)
Every other pack in the table of packs actually tried draws as well, and the table says how close each one comes to Iris. A pack absent from it is one I have not loaded, not one that is unsupported.
After you install
- Switch the game to Vulkan and restart it. Video Settings, "Prefer Vulkan (Experimental)". The backend is picked when the game boots, so it takes effect on the next launch.
- Pick your pack with
I. It opens the shader pack screen,Rreads the pack again from disk andKturns shaders off and back on. All three can be rebound in the game's controls, under Vitrail. - If the frame rate comes up short, there is a slider for it. Video Settings, on Vitrail's own page, "Render Scale": the world is drawn at 25 to 100 percent of the window and brought back to full size before the interface, so menus, chat and the F3 screen stay sharp whatever the scale.
- Distant Horizons is compatible, and your pack's own DH programs draw its far terrain. On Fabric, install it like any other mod. On NeoForge its current release still crashes on the Vulkan renderer (its own texture unwrapper, not this mod), so install this build by hand instead.
- Chloride is not needed, and if you run it, five of its settings decide what reaches your pack: Fast Chests and Fast Beds on the Performance page, Max Entity Distance, Max Monster Distance and Max Block Entity Distance on the Entities page. Vitrail names in the log at startup any it finds on.
Client only, one jar for Fabric and NeoForge. Iris can stay installed beside it, on the Sodium version Iris asks for, which Vitrail runs on too: on Vulkan Vitrail draws, on OpenGL Iris does, and switching the backend in the video settings switches engines. The install guide has the rest.
Links and credits
If a pack or a mod does not work with Vitrail, please open an issue. A pack that draws wrong, a mod that clashes, a crash: every report helps, and if you want to take part, pull requests are very welcome.
Source, what goes through a pack today, the changelog and the full compatibility notes are all at Vitrail-Shaders. It is also on CurseForge.
LGPL-3.0-only. Parts of the pack loader and of the value catalogue are adapted from Iris, which is LGPL-3.0 as well, and the expression grammar is Kroppeb's stareval. What was taken and what was changed on the way is recorded file by file in the project's NOTICE.
下载 Vitrail Shaders
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Vitrail Shaders
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Vitrail Shaders
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Vitrail Shaders
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Vitrail Shaders
下载 Vitrail Shaders
下载 Vitrail Shaders
下载 Vitrail Shaders
下载 Vitrail Shaders
下载 Vitrail Shaders
新增
- 按下
K可关闭并重新开启光影,其效果与在 Iris 下相同。重新开启时,会恢复到之前选择的光影包,并在聊天栏中显示切换方向的信息。如果光影包无法加载(例如加载失败、已从文件夹中移除或未选择任何包),则光影保持关闭状态,聊天栏会显示原因,以便下次按下按键时重试。该按键可在游戏的控制设置中移动,位于 Vitrail 选项下,与打开设置和重新加载包的按键相邻。
修复
- Distant Horizons 自身的云层不会出现在明确要求排除该云层的整合包中。 在安装 Distant Horizons 的情况下,即使光影包(如 Complementary)写入
dhClouds=off,其方块状的云层仍会被绘制在光影包的天空之上。在失明效果下最明显,此时光影包自身的云层变暗,而 Distant Horizons 的云层依然明亮。现在,只要加载了此类光影包,Distant Horizons 的云层就会像 Iris 那样被禁用,同时保留你原有的 Distant Horizons 设置不变。 - Distant Horizons 菜单会注明哪些设置由谁控制且不可更改。 当光影包负责渲染远处地形时,Vitrail 会禁用 Distant Horizons 自身的雾效和环境光遮蔽,并根据光影包的要求禁用其云层。此前,菜单中这些选项显示为锁定状态并标注“由 UNKNOWN 控制”,且 Distant Horizons 会在日志中为每个选项输出警告信息。现在,这些设置将正确显示为由 Vitrail 控制,前提是 Distant Horizons 版本足够新以支持此功能。
- 在 26.3 版本中,挖掘方块时再次显示其裂纹。 加载光影包后,裂纹覆盖层从未出现,导致方块直接破碎。26.3 版本在帧渲染早期(比 26.2 更早)就在实体特征上绘制了普通方块的裂纹,而 Vitrail 此前仅在半透明特征阶段等待它。现在,无论何时,Vitrail 都会使用光影包的
gbuffers_damagedblock来绘制裂纹,因此石头上的裂纹和玻璃上的裂纹都能正常显示。 - 在 26.3 版本中,旗帜的颜色和图案再次正常显示。 加载光影包后,所有旗帜都显示为纯白色布料。26.3 版本在帧渲染早期(比 26.2 更晚的阶段)在实体特征上绘制旗帜的颜色层,而 Vitrail 此前仅在该较晚阶段处理它们,导致游戏引擎在光影包的布料纹理下方自行绘制了颜色。现在,在游戏绘制旗帜的时刻,Vitrail 会使用光影包的半透明方块着色器进行绘制,效果如同在 Iris 下一样。
- 基于 Bliss 的光影包(包括 Eclipse)恢复正常运行。 此前有三个问题阻碍了其运行,前两个足以完全禁用整个光影包:
- 光影包可能在一维图像中存储数据。Bliss 以此方式存储一行方块数据,而游戏的光影检查拒绝读取该数据的任何程序,包括光影包的合成程序。现在,一维图像可以通过这些检查,就像三维图像一直可以那样。
- 光影包可能用不同的主体定义同一个宏两次,NVIDIA 驱动程序接受这种写法,但 Vitrail 使用的编译器不接受。Eclipse 的 composite2 对
diagonal3做了这种操作。现在,每次使用都会采用其所在位置的生效主体,这与驱动程序的解读一致。 - 在 Mac 上,仅传递每个角的几何阶段会被折叠到下一个阶段中。Eclipse 的地形程序以折叠未读取的形状编写该阶段(块状 varyings 一次读取一个角,循环前声明了一个计数器,位置保存在局部变量中),导致光影包的地形程序被搁置,地形在没有它的情况下绘制。现在,该阶段已正确折叠。
- 在 Mac 上,手持物品在玩家行走时不再出现条纹。 在 Photon 下,手中的物品会带有短促的光线虚线,每 32 像素一列,只要行走的摆动动画使其移动就会持续存在。Vitrail 会在游戏绘制的物体遮挡光影包几何体的地方放置游戏自身的画面,并通过比较光影包片段阶段看到的深度与 GPU 存储的深度来区分两者。在 Mac 上,在某些斜面的像素上,这两者可能在最后一位上相差一个单位,导致这些像素被视为被覆盖,并用游戏颜色替换了光影包的 gbuffer。如此微小的差异不再被视为前方有物体。
- 当远处地形加载且视野中无任何地形时,天空不再变为单一的粉色。 在使用 Distant Horizons 或替代它的模组时,光影包会被告知存在远处地形并读取其深度。在某一帧中,如果没有任何地形在屏幕上(例如从世界构建高度上方看向天空),Vitrail 将该深度作为单个纹理像素传递。Photon 逐像素读取它,发现相机后方所有位置都有远处地形,并将整个视图涂成一种粉红色。现在,该深度在整个屏幕范围内都是远平面,就像在 Iris 下模组自身的图像处理方式一样。
- 信标光束的核心不再在相机上方十六个方块处停止。 当光影包绘制天空时,明亮的内部光束在玩家眼睛上方十六条方块处结束于一条水平线,并随玩家上下移动,而微弱的外部辉光则继续向上延伸。Vitrail 允许游戏自身的画面通过游戏在光影包之前绘制的任何地方,并将天空视为在游戏构建它的位置(即上方十六个方块)存在,因此游戏在此高度以上绘制的任何内容都输给了光影包的天空。现在,天空被视为无限远,就像在 Iris 下一样,这也移除了末地中的相同截断现象,因为游戏在那里将天空构建在一百个方块之外。
- 在 Minecraft 26.3 中,加载光影包时,墙后的玩家名称再次可见。 游戏不会隐藏站在墙后的玩家名称,而是将其调暗,并且 26.3 版本在水分和轮廓之后单独绘制这个调暗的名称。Vitrail 未能捕获最后一次绘制,导致名称进入游戏自身的画面,而光影包的最终处理会覆盖该画面,因此名称直接丢失。现在,光影包会像绘制开放空间中的玩家名称一样绘制该名称,并按照游戏的方式将其调暗。潜行状态下的玩家名称在墙后保持隐藏,这与没有光影包时的行为一致。
感谢 elNino0916 提供切换按键、远景云和裂缝效果,Jolymmiles 提供基于 Bliss 的资源包和测试网络,JakobMusix 提供信标光束,DebZakari 提供墙后的名称,以及 Heerless 深入调查铃铛崩溃问题。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧