[PR #5403] [CLOSED] Mipmaps: dither a high-resolution cutout's small levels #6263

Closed
opened 2026-11-03 06:16:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5403
Author: @Teiwazik
Created: 10/31/2026
Status: ❌ Closed

Base: main ← Head: fix/cutout-mips-keep-coverage


📝 Commits (5)

  • 03829bb Mipmaps: dither a high-resolution cutout's small levels
  • 82bd9f6 Merge main into #5403
  • 11843ac Mipmaps: put the cutout dither behind a graphics option, off by default
  • 89be625 Docs: the dither option's row has three cells
  • 6018159 Merge remote-tracking branch 'origin/main' into fix/cutout-mips-keep-coverage

📊 Changes

7 files changed (+148 additions, -1 deletions)

View changed files

📝 crates/horizon-client-render/src/graphics.rs (+8 -1)
📝 crates/horizon-client-render/src/graphics_ui.rs (+9 -0)
📝 crates/horizon-client-render/src/mipmap.rs (+123 -0)
📝 crates/horizon-client-render/src/settings.rs (+1 -0)
📝 crates/horizon-client-render/src/sprites.rs (+1 -0)
📝 crates/horizon-client/src/game/options.rs (+5 -0)
📝 docs/graphics.md (+1 -0)

📄 Description

🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally.

What

For a cutout whose base level is at least 64 texels wide, each level below the base now takes the mean alpha through a 4x4 ordered dither: its texels are in or out, about as many in as the base has. Smaller textures, vanilla's included, keep scaleAlphaToCoverage alone. The sprite cache's VERSION goes to 2, so decoded textures are rebuilt once.

Tests

a_high_resolution_cutouts_fine_detail_keeps_its_coverage_in_small_mips: blades one texel wide, one column in four, keep 15-35% coverage in the small levels. Distant grass looked right by eye on our fork's client with a high-resolution pack, but that client also carries a separate downscaling change, so this branch alone wasn't checked in game. No screenshot is attached.

Fixes #5402

Windows note. On this machine pr_ready can't build main: horizon-threads lacks the windows-sys features boot_paint uses (#5298, #5299), which is why clippy, tests and doc tests are red in the block below. The block is from main at 47f372fee. With those features turned on locally, not committed, on main at 5d16a611c:

  • cargo clippy --profile fast -p horizon-client-render --all-targets --no-deps -- -D warnings passes;
  • cargo test -p horizon-client-render --lib passes;
  • cargo fmt --all --check passes.

Not run: parity harnesses and lan_e2e. CI runs on Linux and doesn't have this problem.

pr_ready (tools/pr_ready.py --quick on Teiwazik, against origin/main at 47f372fee, 2 min 2 s)

Check Result
Scope ✅ 2 files, +71 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 505 passed (1 min 3 s)
rustfmt ✅ (11 s)
clippy ❌ failed (14 s)
tests: horizon-client-render ❌ failed (27 s)
doc tests ❌ failed (5 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code

https://claude.ai/code/session_01EBqm1v5zTsDGwuZF6XKFjL


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5403 **Author:** [@Teiwazik](https://github.com/Teiwazik) **Created:** 10/31/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/cutout-mips-keep-coverage` --- ### 📝 Commits (5) - [`03829bb`](https://github.com/horizon-rust/horizon/commit/03829bb88eb3d2d789e0b6d2efe26f25a0853df3) Mipmaps: dither a high-resolution cutout's small levels - [`82bd9f6`](https://github.com/horizon-rust/horizon/commit/82bd9f6f37cb31b28c7e59a8fa29e3702d55ae18) Merge main into #5403 - [`11843ac`](https://github.com/horizon-rust/horizon/commit/11843ac18b909eb7535b7fc6239724dc8b747546) Mipmaps: put the cutout dither behind a graphics option, off by default - [`89be625`](https://github.com/horizon-rust/horizon/commit/89be6259dad985ad39955cb64eef3a6274db6354) Docs: the dither option's row has three cells - [`6018159`](https://github.com/horizon-rust/horizon/commit/6018159ff1007fcd31cf814b1c5bbb637cc18928) Merge remote-tracking branch 'origin/main' into fix/cutout-mips-keep-coverage ### 📊 Changes **7 files changed** (+148 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/graphics.rs` (+8 -1) 📝 `crates/horizon-client-render/src/graphics_ui.rs` (+9 -0) 📝 `crates/horizon-client-render/src/mipmap.rs` (+123 -0) 📝 `crates/horizon-client-render/src/settings.rs` (+1 -0) 📝 `crates/horizon-client-render/src/sprites.rs` (+1 -0) 📝 `crates/horizon-client/src/game/options.rs` (+5 -0) 📝 `docs/graphics.md` (+1 -0) </details> ### 📄 Description > 🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally. ## What For a cutout whose base level is at least 64 texels wide, each level below the base now takes the mean alpha through a 4x4 ordered dither: its texels are in or out, about as many in as the base has. Smaller textures, vanilla's included, keep `scaleAlphaToCoverage` alone. The sprite cache's `VERSION` goes to 2, so decoded textures are rebuilt once. ## Tests `a_high_resolution_cutouts_fine_detail_keeps_its_coverage_in_small_mips`: blades one texel wide, one column in four, keep 15-35% coverage in the small levels. Distant grass looked right by eye on our fork's client with a high-resolution pack, but that client also carries a separate downscaling change, so this branch alone wasn't checked in game. No screenshot is attached. Fixes #5402 **Windows note.** On this machine `pr_ready` can't build main: `horizon-threads` lacks the `windows-sys` features `boot_paint` uses (#5298, #5299), which is why clippy, tests and doc tests are red in the block below. The block is from main at 47f372fee. With those features turned on locally, not committed, on main at 5d16a611c: - `cargo clippy --profile fast -p horizon-client-render --all-targets --no-deps -- -D warnings` passes; - `cargo test -p horizon-client-render --lib` passes; - `cargo fmt --all --check` passes. Not run: parity harnesses and `lan_e2e`. CI runs on Linux and doesn't have this problem. **pr_ready** (`tools/pr_ready.py --quick` on Teiwazik, against origin/main at 47f372fee, 2 min 2 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +71 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 505 passed (1 min 3 s) | | rustfmt | ✅ (11 s) | | clippy | ❌ failed (14 s) | | tests: horizon-client-render | ❌ failed (27 s) | | doc tests | ❌ failed (5 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EBqm1v5zTsDGwuZF6XKFjL --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:16:43 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6263
No description provided.