Skip to content

fix: remove wildcard GUI atlas sweep causing black screen on low-VRAM hardware#140

Merged
gigabit101 merged 1 commit into
CreeperHost:multi/26.1.2from
Mattabase:fix/atlas-bloat
Jun 2, 2026
Merged

fix: remove wildcard GUI atlas sweep causing black screen on low-VRAM hardware#140
gigabit101 merged 1 commit into
CreeperHost:multi/26.1.2from
Mattabase:fix/atlas-bloat

Conversation

@Mattabase

@Mattabase Mattabase commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Problem

PolyLib's assets/minecraft/atlases/gui.json added a directory source scanning textures/gui/ across all mod namespaces:

{ "type": "directory", "source": "gui", "prefix": "gui/" }

Vanilla MC only scans textures/gui/sprites/ (small purpose-built sprites). PolyLib's addition swept every mod's textures/gui/ directory — including large 256×256 container background textures that were never meant to be atlased.

In large modpacks like ATM 11 (400+ mods), this bloats the minecraft:gui atlas well beyond what VRAM-constrained hardware can handle. Reported as a black screen on Intel HD 4600 (shared VRAM, old driver reporting OpenGL 3.3, GL_MAX_TEXTURE_SIZE likely 4096–8192).

Fix

  1. Delete assets/minecraft/atlases/gui.json — no more wildcard sweep
  2. Move PolyLib sprites from textures/gui/*textures/gui/sprites/* — vanilla's atlas definition already scans this path
  3. Update PolyTextures.getUncached() — drop the gui/ prefix to match vanilla's empty-prefix directory scan

Why this works

Vanilla's gui.json already includes:

{ "type": "minecraft:directory", "prefix": "", "source": "gui/sprites" }

A texture at assets/polylib/textures/gui/sprites/widgets/slot.png becomes sprite polylib:widgets/slot in the minecraft:gui atlas automatically. No custom atlas definition needed.

Impact

  • No API change — callers of PolyTextures.get("slots/dust") etc. are unaffected (the gui/ prefix was added internally)
  • Downstream mods (Shrink, etc.) need no changes
  • Tested — NeoForge and Fabric testmods launches and renders correctly

Origin

The directory source was introduced by brandon3055 in Nov 2023 (MC 1.20) under assets/polylib/atlases/gui.json for a PolyLib-specific atlas. Migrated to assets/minecraft/atlases/gui.json in May 2026 (commit afdd73e) to eliminate atlas registration mixins — but the wildcard sweep then began affecting the shared vanilla GUI atlas.

PolyLib's assets/minecraft/atlases/gui.json used a directory source
scanning textures/gui/ across ALL mod namespaces. In large modpacks
(400+ mods), this swept hundreds of large GUI background textures
into the minecraft:gui atlas, bloating it beyond GL_MAX_TEXTURE_SIZE
on VRAM-constrained hardware (e.g. Intel HD 4600) causing black screens.

Fix: move PolyLib sprites to textures/gui/sprites/ (already scanned by
vanilla's atlas definition) and remove the custom atlas JSON entirely.
Drop the 'gui/' prefix in PolyTextures.getUncached() to match vanilla's
empty-prefix directory scan.
@gigabit101 gigabit101 merged commit 39f9f3a into CreeperHost:multi/26.1.2 Jun 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants