[PR #4843] [MERGED] Texture Filtering (RGSS, Anisotropic) and Max Anisotropy on terrain #5888

Closed
opened 2026-11-03 05:15:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4843
Author: @levzzz5154
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @levzzz5154

Base: main ← Head: parity/I-aniso


📝 Commits (1)

  • 2e1da6d Texture Filtering (None, RGSS, Anisotropic) and Max Anisotropy on terrain

📊 Changes

5 files changed (+211 additions, -32 deletions)

View changed files

📝 crates/horizon-client-render/src/entity.wgsl (+1 -0)
📝 crates/horizon-client-render/src/gfx.rs (+108 -20)
📝 crates/horizon-client-render/src/options_ui.rs (+19 -6)
📝 crates/horizon-client-render/src/terrain.wgsl (+79 -6)
📝 crates/horizon-client/src/game/options.rs (+4 -0)

📄 Description

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

Part of #3518

Rows:

  • Options.maxAnisotropyValue: 1 << maxAnisotropyBit (wgpu caps at 16) sets the anisotropy clamp of the terrain sampler when Texture Filtering is Anisotropic; applied live by Renderer::set_texture_filtering.
  • VideoSettingsScreen.qualityOptions: the Texture Filtering and Max Anisotropy rows (greyed out by #4729) are enabled. As in VideoSettingsScreen.tick, Max Anisotropy is greyed unless Anisotropic is selected.

Vanilla followed: LevelRenderer chunk layer sampler (linear/linear, clamp to edge, anisotropy), GameRenderer (UseRgss), terrain.fsh and texture_sampling.glsl (sampleNearest, sampleRGSS), written as WGSL in terrain.wgsl. The sprites are array layers, so vanilla's stitcher padding for anisotropy is not needed.

None (default) keeps today's nearest sampler and plain sampling, so its output is unchanged (vanilla itself runs sampleNearest even then; keeping today's output was asked for). A filtering field is appended to Globals (terrain.wgsl, entity.wgsl, gfx.rs).

Tests: sampler descriptors per mode and the Video rows' availability/greying; the globals layout test and the WGSL validation tests pass. Checked by eye in the game (offscreen, over grass at a shallow angle): None identical to before, Anisotropic and RGSS keep crisp texels and smooth the distance, no seams.

🤖 Generated with Claude Code


🔄 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/4843 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/I-aniso` --- ### 📝 Commits (1) - [`2e1da6d`](https://github.com/horizon-rust/horizon/commit/2e1da6db52e6dc63eb5c1126914d967583a1c625) Texture Filtering (None, RGSS, Anisotropic) and Max Anisotropy on terrain ### 📊 Changes **5 files changed** (+211 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/entity.wgsl` (+1 -0) 📝 `crates/horizon-client-render/src/gfx.rs` (+108 -20) 📝 `crates/horizon-client-render/src/options_ui.rs` (+19 -6) 📝 `crates/horizon-client-render/src/terrain.wgsl` (+79 -6) 📝 `crates/horizon-client/src/game/options.rs` (+4 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3518 Rows: - `Options.maxAnisotropyValue`: `1 << maxAnisotropyBit` (wgpu caps at 16) sets the anisotropy clamp of the terrain sampler when Texture Filtering is Anisotropic; applied live by `Renderer::set_texture_filtering`. - `VideoSettingsScreen.qualityOptions`: the Texture Filtering and Max Anisotropy rows (greyed out by #4729) are enabled. As in `VideoSettingsScreen.tick`, Max Anisotropy is greyed unless Anisotropic is selected. Vanilla followed: `LevelRenderer` chunk layer sampler (linear/linear, clamp to edge, anisotropy), `GameRenderer` (UseRgss), `terrain.fsh` and `texture_sampling.glsl` (`sampleNearest`, `sampleRGSS`), written as WGSL in `terrain.wgsl`. The sprites are array layers, so vanilla's stitcher padding for anisotropy is not needed. None (default) keeps today's nearest sampler and plain sampling, so its output is unchanged (vanilla itself runs sampleNearest even then; keeping today's output was asked for). A `filtering` field is appended to `Globals` (terrain.wgsl, entity.wgsl, gfx.rs). Tests: sampler descriptors per mode and the Video rows' availability/greying; the globals layout test and the WGSL validation tests pass. Checked by eye in the game (offscreen, over grass at a shallow angle): None identical to before, Anisotropic and RGSS keep crisp texels and smooth the distance, no seams. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:15:42 +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#5888
No description provided.