[PR #4810] [MERGED] Chunk sections fade in over chunkSectionFadeInTime #5864

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

📋 Pull Request Information

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

Base: main ← Head: parity/C-chunk-fade


📝 Commits (1)

  • 1c6992a Chunk sections fade in over chunkSectionFadeInTime, block entities wait for 0.3

📊 Changes

4 files changed (+161 additions, -24 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+113 -5)
📝 crates/horizon-client-render/src/gfx/pack_atlas.rs (+1 -1)
📝 crates/horizon-client-render/src/terrain.wgsl (+28 -5)
📝 crates/horizon-client/src/game.rs (+19 -13)

📄 Description

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

Part of #3519

Rows:

  • SectionRenderDispatcher.RenderSection.getVisibility: each section remembers when it was first uploaded (kept across re-meshing, dropped with its column) and fades in over chunkSectionFadeInTime (gfx.rs chunk_visibility, fade_millis). Block entities of a section wait for visibility 0.3 (Renderer::visible_block_entities, used by the block-entity draw like LevelExtractor.extractVisibleBlockEntities).
  • DynamicGpuData.writeChunkSections, DynamicGpuData.writeChunkSectionsInstanced, DynamicGpuData.ChunkSectionInfo.write: the instance record's w already held the UV step (a power of two); its free mantissa now carries 1 - visibility (section_instance). It reaches vs_terrain (instance attribute), vs_terrain_flat (slot origins) and the shadow list. terrain.wgsl decodes it (instance_step, instance_visibility), applies terrain.vsh's mix(1.0, vis, clamp((dist - 16) / 16, 0, 1)) and terrain.fsh's mix(FogColor * vec4(1,1,1,a), color, chunkVisibility) in fs_solid and fs_translucent.

Notes:

  • Option Off (0) or a fully visible section writes the bare step: the same instance bytes and the same colours as before.
  • Shader packs (native material and GLSL pack_atlas) now only decode the step (masked) and draw without the fade; a pack replaces terrain's look.
  • Sections that already dither in over far-terrain tiles (Horizon's LOD fade) keep that and skip the vanilla fade, so the two don't stack. Distant LOD tiles are not vanilla sections and are untouched.

Vanilla followed: SectionRenderDispatcher.RenderSection.getVisibility/updateUploadTime/reset, LevelRenderer.extractSectionDrawGroups, LevelExtractor.extractVisibleBlockEntities, DynamicGpuData.ChunkSectionInfo, Util.toMillis, terrain.vsh/terrain.fsh.

Tests: unit tests for chunk_visibility, fade_millis and the instance packing (Off is the bare step); cargo test -p horizon-client-render --lib passes, clippy clean. Visual check on a fast build, offscreen: terrain is visible and opaque after the fade.

🤖 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/4810 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/C-chunk-fade` --- ### 📝 Commits (1) - [`1c6992a`](https://github.com/horizon-rust/horizon/commit/1c6992a28c3134e895bf5d37258e9d65e2d48513) Chunk sections fade in over chunkSectionFadeInTime, block entities wait for 0.3 ### 📊 Changes **4 files changed** (+161 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+113 -5) 📝 `crates/horizon-client-render/src/gfx/pack_atlas.rs` (+1 -1) 📝 `crates/horizon-client-render/src/terrain.wgsl` (+28 -5) 📝 `crates/horizon-client/src/game.rs` (+19 -13) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3519 Rows: - `SectionRenderDispatcher.RenderSection.getVisibility`: each section remembers when it was first uploaded (kept across re-meshing, dropped with its column) and fades in over `chunkSectionFadeInTime` (`gfx.rs` `chunk_visibility`, `fade_millis`). Block entities of a section wait for visibility 0.3 (`Renderer::visible_block_entities`, used by the block-entity draw like `LevelExtractor.extractVisibleBlockEntities`). - `DynamicGpuData.writeChunkSections`, `DynamicGpuData.writeChunkSectionsInstanced`, `DynamicGpuData.ChunkSectionInfo.write`: the instance record's `w` already held the UV step (a power of two); its free mantissa now carries `1 - visibility` (`section_instance`). It reaches `vs_terrain` (instance attribute), `vs_terrain_flat` (slot origins) and the shadow list. `terrain.wgsl` decodes it (`instance_step`, `instance_visibility`), applies terrain.vsh's `mix(1.0, vis, clamp((dist - 16) / 16, 0, 1))` and terrain.fsh's `mix(FogColor * vec4(1,1,1,a), color, chunkVisibility)` in `fs_solid` and `fs_translucent`. Notes: - Option Off (0) or a fully visible section writes the bare step: the same instance bytes and the same colours as before. - Shader packs (native material and GLSL `pack_atlas`) now only decode the step (masked) and draw without the fade; a pack replaces terrain's look. - Sections that already dither in over far-terrain tiles (Horizon's LOD fade) keep that and skip the vanilla fade, so the two don't stack. Distant LOD tiles are not vanilla sections and are untouched. Vanilla followed: `SectionRenderDispatcher.RenderSection.getVisibility/updateUploadTime/reset`, `LevelRenderer.extractSectionDrawGroups`, `LevelExtractor.extractVisibleBlockEntities`, `DynamicGpuData.ChunkSectionInfo`, `Util.toMillis`, terrain.vsh/terrain.fsh. Tests: unit tests for `chunk_visibility`, `fade_millis` and the instance packing (Off is the bare step); `cargo test -p horizon-client-render --lib` passes, clippy clean. Visual check on a fast build, offscreen: terrain is visible and opaque after the fade. 🤖 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:31 +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#5864
No description provided.