

Longview 是一款针对 Minecraft 26.1 的模组,用于修复远距离渲染中的 Z-fighting(深度冲突)和锯齿等故障。
该模组通过以下两种技术实现这一目标:
- 使用
GL_ARB_CLIP_CONTROL 扩展(正式成为 OpenGL 4.5 的一部分),将 Z 坐标限制从 [-1,1] 更改为 [0,1]
- 应用反向 Z 技术,即在渲染器中交换远平面和近平面的位置
这确保了无论距离多远,深度缓冲区都能均匀分布,从而修复所有由远距离渲染引发的故障!
兼容性
在 Minecraft 26.2+ 版本中,由于游戏已内置了 Longview 所实现的相同修复功能,因此不再需要此模组。本模组仍可在 Minecraft 26.1 中正常工作。
为了应用第一种技术,设备需支持 GL_ARB_CLIP_CONTROL 扩展或 OpenGL 4.5。
在不支持上述扩展的设备上(例如运行 macOS 的设备),仍将应用第二种技术。但由于 Z 坐标限制保持为 [-1,1],翻转这些限制实际上不会有任何效果,因为该限制本质上是对称的。
自 Longview 1.3.0 起,当使用支持该功能的着色包时,本模组可与 Iris Shaders 兼容。如果着色包不支持 Longview,则本模组会暂时禁用自身,如 F3 调试信息所示。
本模组完全兼容自定义图形后端,并将默认实施第二种技术,尽管这些自定义后端需要自行实现第一种技术。
致谢


Longview is a mod for Minecraft 26.1 that fixes glitches such as Z-fighting and jaggies on far distances.
This is accomplished through two techniques:
- By changing the Z coordinate limits from [-1,1] to [0,1] using the
GL_ARB_CLIP_CONTROL extension (officially part of OpenGL 4.5)
- By applying the reversed Z technique, where the far plane and the near plane are swapped in the renderer.
This ensures that the depth buffer will be evenly distributed no matter the distance, fixing all sorts of glitches that happens from a distance!
Compatibility
This mod is no longer needed in Minecraft 26.2+ since the game has implemented the same fixes that Longview implements! This mod will continue to work in Minecraft 26.1.
This mod requires a device supporting either the GL_ARB_CLIP_CONTROL extension or OpenGL 4.5 in order to apply Technique 1.
On devices that don't support either, like ones running macOS, Technique 2 will still be applied, although since the Z coordinate limits will remain as [-1,1], flipping them will do nothing at all considering said limit is effectively symmetric.
As of Longview 1.3.0, this mod is compatible with Iris Shaders when using shader packs that support it. If the shader pack doesn't support Longview, then this mod will disable itself temporarily, as shown in the F3 debug information.
This mod is fully compatible with custom graphics backends and will implement Technique 2 by default, although said custom backends are required to implement Technique 1 themselves.
Acknowledgements
- This Godot Engine blog post for introducing me to the reverse Z technique.
- Depth Precision Visualized: an excellent article covering the topic of depth precision as well as the reverse Z technique.
- The many people who have independently discovered and popularized this technique, including goddamn Quake developers.
- qendolin for putting together the farz-poc proof-of-concept and for starting discussions involving Mojang developers.
- IMS for he's a jolly good fellow, which nobody can deny.
评论 0
登录后参与评分
还没有评论,来抢沙发吧