[PR #6212] [MERGED] Shader packs: centerDepthSmooth #6720

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6212
Author: @arslanarm
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: shaderpacks/center-depth-smooth


📝 Commits (2)

  • e266d70 Shader packs: centerDepthSmooth
  • e5aa089 Merge main into shader-packs centerDepthSmooth

📊 Changes

4 files changed (+334 additions, -0 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+4 -0)
➕ crates/horizon-client-render/src/gfx/pack_center_depth.rs (+296 -0)
📝 crates/horizon-client-render/src/gfx/pack_post.rs (+18 -0)
📝 crates/horizon-client-render/src/gfx/pack_uniforms.rs (+16 -0)

📄 Description

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

Fixes #6209.

What and why

centerDepthSmooth: depthtex0 at the screen's centre, smoothed over time. Packs focus depth of field with it; it was zero.

  • gfx/pack_center_depth.rs: a depth texture can only be copied whole, so a one-pixel pass textureLoads the centre texel into a 1x1 R32Float target, copied into one of three small buffers and mapped after submission, read back frames later without waiting for the GPU (as timing.rs reads its timestamps). A frame with no free buffer skips the copy.
  • PackPost copies at the end of run (depthtex0 as the frame leaves it) and collects before the uniforms update; FrameUniforms smooths with centerDepthHalflife's default, 1 tick, through the same smooth as wetness; the first value read is taken as is, and before any arrives the uniform is 1.0.

Tested

the_centre_depth_comes_back (GPU, run on Vulkan with an RTX 5090: a cleared depth comes back through the ring, and the buffers are reused). In the game the uniform is no longer "zero for now". I have not compared a pack's depth of field with Iris's picture.

Sources

OptiFine's shaders.txt (centerDepthHalflife = 1 (ticks)), the shaders.properties uniform reference. No Iris, OptiFine or pack code read.

Suggested label: feature.

pr_ready (tools/pr_ready.py --quick on plony-pc, against origin/main at 7311b1e17, 3 min 35 s)

Check Result
Scope ✅ 4 files, +334 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 586 passed (31 s)
rustfmt ✅ (7 s)
clippy ✅ (1 min 34 s)
tests: horizon-client-render ✅ 918 passed (1 min 23 s)
doc tests ✅ 0 passed (1 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


🔄 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/6212 **Author:** [@arslanarm](https://github.com/arslanarm) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shaderpacks/center-depth-smooth` --- ### 📝 Commits (2) - [`e266d70`](https://github.com/horizon-rust/horizon/commit/e266d70800a6bb1e858d3d4042da566c1885bed3) Shader packs: centerDepthSmooth - [`e5aa089`](https://github.com/horizon-rust/horizon/commit/e5aa08936cfdd8fc2a84296857c6637e644a3efb) Merge main into shader-packs centerDepthSmooth ### 📊 Changes **4 files changed** (+334 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+4 -0) ➕ `crates/horizon-client-render/src/gfx/pack_center_depth.rs` (+296 -0) 📝 `crates/horizon-client-render/src/gfx/pack_post.rs` (+18 -0) 📝 `crates/horizon-client-render/src/gfx/pack_uniforms.rs` (+16 -0) </details> ### 📄 Description > 🤖 Opened by arslanarm's AI agent (Claude Code, Claude Opus 5.5), not by arslanarm personally. Fixes #6209. ## What and why `centerDepthSmooth`: depthtex0 at the screen's centre, smoothed over time. Packs focus depth of field with it; it was zero. - `gfx/pack_center_depth.rs`: a depth texture can only be copied whole, so a one-pixel pass `textureLoad`s the centre texel into a 1x1 `R32Float` target, copied into one of three small buffers and mapped after submission, read back frames later without waiting for the GPU (as `timing.rs` reads its timestamps). A frame with no free buffer skips the copy. - `PackPost` copies at the end of `run` (depthtex0 as the frame leaves it) and collects before the uniforms update; `FrameUniforms` smooths with `centerDepthHalflife`'s default, 1 tick, through the same `smooth` as `wetness`; the first value read is taken as is, and before any arrives the uniform is 1.0. ## Tested `the_centre_depth_comes_back` (GPU, run on Vulkan with an RTX 5090: a cleared depth comes back through the ring, and the buffers are reused). In the game the uniform is no longer "zero for now". I have not compared a pack's depth of field with Iris's picture. ## Sources OptiFine's shaders.txt (`centerDepthHalflife = 1 (ticks)`), the shaders.properties uniform reference. No Iris, OptiFine or pack code read. Suggested label: `feature`. **pr_ready** (`tools/pr_ready.py --quick` on plony-pc, against origin/main at 7311b1e17, 3 min 35 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +334 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 586 passed (31 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (1 min 34 s) | | tests: horizon-client-render | ✅ 918 passed (1 min 23 s) | | doc tests | ✅ 0 passed (1 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:25:25 +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#6720
No description provided.