Skip to content

Render chest overlays flush with the chest surface - #15

Merged
rubensworks merged 1 commit into
master-1.21-ltsfrom
fix/flush-overlays
Oct 11, 2026
Merged

rubensworks merged 1 commit into
master-1.21-ltsfrom
fix/flush-overlays

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Overlays (the functional wall icons shown while sneaking, the core marker, Display wall panels) floated a fixed 1/32 block in front of the chest, which was visible as a gap from an angle.

Changes

  • The overlay offset now scales with camera distance (1/2048 per block, at least 1/1024), like vanilla's view offset layering. Up close it is about 1/1000 of a block, so overlays look flush; at 64 blocks it equals the old 1/32, so there is no z-fighting at range.
  • The Display wall's internal layers (frame, panel, item, text, fill bar) were a fixed 0.0005 apart and z-fought at range: the wood frame bled through the panel at 64+ blocks, also before this change. They now use half the distance-scaled offset.
  • Dropped the Display panel's sides (renderSides), since there is no gap left to cover. The public helper stays for addons.
  • RenderChestCore.applyFaceTransform takes the offset as a parameter; OVERLAY_OFFSET is replaced by getOverlayOffset.

Testing

  • ./gradlew build and runGameTestServer pass (NeoForge, Forge, Fabric).
  • New unit test for the offset; transform tests updated.
  • Checked in a NeoForge dev client with clientdevbridge while sneaking, at 3, 16, 32, 64 and 96 blocks and at grazing angles: overlays are flush and there is no z-fighting. A fixed 1/1024 offset was tried first, and z-fought from 16 blocks on, hence the distance scaling.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RSz5r6eowhjNuANBjZE2v6


Generated by Claude Code

Overlays floated a fixed 1/32 block in front of the chest. They now sit
a tiny offset in front that grows with camera distance, like vanilla's
view offset layering, so they look flush up close and still avoid
z-fighting far away. The Display wall's internal layers scale the same
way, which also fixes its frame bleeding through the panel at range.
The panel sides are dropped, as there is no gap left to cover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RSz5r6eowhjNuANBjZE2v6
@rubensworks
rubensworks merged commit 82bd597 into master-1.21-lts Oct 11, 2026
3 checks passed
@rubensworks
rubensworks deleted the fix/flush-overlays branch October 11, 2026 05:10
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 38113801969

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.005%) to 76.527%

Details

  • Coverage decreased (-0.005%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 30 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

30 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
org/cyclops/colossalchests2/client/render/RenderChestCore.java 22 28.81%
org/cyclops/colossalchests2/client/render/DisplayWallOverlay.java 8 0.0%

Coverage Stats

Coverage Status
Relevant Lines: 6894
Covered Lines: 5578
Line Coverage: 80.91%
Relevant Branches: 2849
Covered Branches: 1878
Branch Coverage: 65.92%
Branches in Coverage %: Yes
Coverage Strength: 9.89 hits per line

💛 - Coveralls

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.

3 participants