Back to mods
Window Resize Fix (Iris & Distant Horizons) project artwork

CurseForge · Minecraft mod

Window Resize Fix (Iris & Distant Horizons)

Fixes Distant Horizons breaking after a window resize with Iris, and the world's depth buffer not following a replaced render target.

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which Window Resize Fix (Iris & Distant Horizons) release should I use?

Updated 20 days ago
Latest stable file Window Resize Fix 1.4.0 Fabric (MC 1.20.1-1.21.4)
Game version 1.21, 1.20.2, 1.20.5
Loader Fabric

Window Resize Fix (Iris & Distant Horizons) Window Resize Fix 1.4.0 Fabric (MC 1.20.1-1.21.4) targets 1.21, 1.20.2, 1.20.5 with Fabric. The project page does not say whether this file belongs on the client, dedicated server, or both. All 2 required mods have matching files.

Where it goes

Is Window Resize Fix (Iris & Distant Horizons) required on the client, server, or both?

The project page does not say whether this file belongs on the client, dedicated server, or both.

Client Source doesn’t say
Dedicated server Source doesn’t say
Loader for this release Fabric
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source does not explicitly classify this release as client-only or server-only.

What else does Window Resize Fix (Iris & Distant Horizons) Window Resize Fix 1.4.0 Fabric (MC 1.20.1-1.21.4) need?

Window Resize Fix 1.4.0 Fabric (MC 1.20.1-1.21.4). Change the file and its required mods may change too.

All 2 required mods have matching files

Install Iris Shaders, Sodium first. We found matching files for this game-version and loader setup. 1 comes through another mod in the chain.

2 listed on this file 1 pulled in by one of those mods
Iris Shaders Needed by Window Resize Fix (Iris & Distant Horizons) Window Resize Fix 1.4.0 Fabric (MC 1.20.1-1.21.4)
required
Matching file found Matched file: Iris 1.7 for Minecraft 1.20.6
Distant Horizons: A Level of Detail mod Optional for Window Resize Fix (Iris & Distant Horizons) Window Resize Fix 1.4.0 Fabric (MC 1.20.1-1.21.4)
optional
Matching file found Matched file: 3.3.3 - 1.21.4 neo/fabric
Sodium Needed by Iris Shaders
pulled in
Matching file found Matched file: Sodium 0.8.13 for Fabric 1.21.1

1 extra mod was pulled in by another dependency. Indented rows show who needs each one. We only count dependency files that match this setup. A file for another loader does not fill the gap.

Before you install it

Add Window Resize Fix (Iris & Distant Horizons) without breaking your instance.

Built for Window Resize Fix (Iris & Distant Horizons) Window Resize Fix 1.4.0 Fabric (MC 1.20.1-1.21.4). Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use Window Resize Fix 1.4.0 Fabric (MC 1.20.1-1.21.4). It targets 1.21, 1.20.2, 1.20.5 with Fabric; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    Install Iris Shaders, Sodium first. We found matching files for this game-version and loader setup. 1 comes through another mod in the chain.

  3. 03

    Put it on the correct side

    The project page does not say whether this file belongs on the client, dedicated server, or both.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside Window Resize Fix 1.4.0 Fabric (MC 1.20.1-1.21.4). It opens that exact file at the source.

About this project

What does Window Resize Fix (Iris & Distant Horizons) add?

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.

Project description from CurseForge.

Pick your setup

Window Resize Fix (Iris & Distant Horizons) by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

29 available setups

Showing the newest 12 of 23 game versions. Older files are in the list below.

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

Window Resize Fix (Iris & Distant Horizons) versions and loaders

6 of 6 releases match

Looking for an older file? The official CurseForge project page is in Resources.