Community listing page, reviews here may not be monitored by the author.
Window Resize Fix (Iris & Distant Horizons)
No reviews yet
Fixes Distant Horizons breaking after a window resize with Iris, and the world's depth buffer not following a replaced render target.
Community voices
Reviews
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
Resources
External Links
About
Description
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.
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers
Statistics
Resources