Window Resize Fix (Iris & Distant Horizons)
修复 Iris 中调整窗口大小后 Distant Horizons 出现故障,以及世界深度缓冲区未跟随替换后的渲染目标的问题。
介绍
What this is
A small client mod that fixes two depth-buffer defects in Iris, both of which come from the same
place: Iris does not own a depth buffer for the world, it borrows Minecraft’s — and it decides when
to re-borrow it from a counter that cannot answer the question being asked.
Minecraft 1.21.1 / NeoForge 21.1.x. Nothing is written to your world.
Fix 1 — Distant Horizons dies after you resize the window
No render-scaling mod required. This one affects plain Iris + Distant Horizons.
Drag the edge of the game window, or go in or out of fullscreen, and Distant Horizons stops drawing.
It stays broken until you reload the world.
The cause: when Iris resizes its render targets it walks every framebuffer it owns and hangs
Minecraft’s depth texture on each — and the Distant Horizons framebuffers are on that list, though
they must keep DH’s own depth. The reconnect that would put it back is guarded by a check on the
texture’s id, and DH’s id never changed. Only the attachment did. So nothing ever restores it.
This mod clears the remembered id at the head of that reconnect, so Iris’s own code re-attaches
normally.
Fix 2 — the world’s depth does not follow a replaced render target
If you use anything that renders the world at a resolution other than the window’s — a render scaler,
a dynamic resolution mod — Iris ends up drawing into colour buffers of one size against a depth
buffer of another. Distant Horizons LODs draw on top of everything, and the world can come out
stretched or doubled.
The cause, read out of Iris’s compiled code:
// RenderTargets.resizeIfNeeded and DHCompatInternal.reconnectDHTextures
if (depthBufferVersion != cachedDepthBufferVersion) { /* only here is a new depth taken */ }
That counter answers “has this target recreated its buffers?” It cannot answer “is this a
different target now?” — which is exactly what happens when another mod hands Minecraft a different
main render target.
The advice usually given for the symptom is “resize the game window until it fixes itself”. That
works precisely because resizing makes Minecraft recreate its target, which bumps the counter.
This mod compares the depth texture’s id, and the Distant Horizons texture’s size, instead of
the counter. In ordinary play that is one integer comparison per frame.
What is proven and what is not
Both defects are read directly from Iris 1.8.14’s bytecode, and fix 1 is confirmed in play: with the
mod installed the log shows the DH depth texture being re-attached as the world resolution changes,
and DH keeps rendering.
What has not been done is a controlled before/after against the open upstream report whose
symptoms match fix 2 (RenderScale#59). The
mechanism is proven; the claim “this fixes that issue” is not made here. During development, one
picture defect that looked exactly like it turned out to have a completely unrelated cause — another
mod leaking a viewport in the middle of the frame.
Requirements
Minecraft 1.21.1, NeoForge 21.1.x, Iris. Distant Horizons optional — without it, fix 1 simply has
nothing to act on.
License
MIT.
常见问题
Window Resize Fix (Iris & Distant Horizons) 支持哪些 Minecraft 版本?
Window Resize Fix (Iris & Distant Horizons) 支持 Minecraft Java 版 1.20.1–26.3,共 23 个版本,可用的加载器:Fabric / NeoForge。下载时注意选择和你游戏版本一致的文件。
Window Resize Fix (Iris & Distant Horizons) 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
mzg 的其他作品
查看全部 →Vira
Renders the world below native with an FSR 1.0 upscale and rebuilds the shader shadow map every Nth frame. Never invents a frame.
Gear Vanish
Turn your armor into cosmetics: hide it, or keep only the trim glowing on bare skin. Synced to everyone, with rules that bring gear back when it matters.
Flywheel OIT Fix
Fixes Create's shafts and cogwheels rendering as blown-out white shapes under shaders
TFMG Electricity Performance Patch
Fixes the per-tick electrical network rebuild loop and the quadratic network update in Create: The Factory Must Grow.
评论
登录后评论和评分