Skip to content

Fix translucent items vanishing behind water and glass (v1.2.0)#2

Draft
ReimaginedPixel wants to merge 4 commits into
mainfrom
claude/translucent-entity-render-fix-3uudne
Draft

Fix translucent items vanishing behind water and glass (v1.2.0)#2
ReimaginedPixel wants to merge 4 commits into
mainfrom
claude/translucent-entity-render-fix-3uudne

Conversation

@ReimaginedPixel

Copy link
Copy Markdown
Owner

What & why

Translucent entities (armor stands and the items they hold or wear) render in a separate pass from translucent blocks such as water and glass. Vanilla only depth-sorts render layers within each pass, never across them — so a translucent item near a translucent block has no defined blend order and its alpha pixels composite incorrectly. Most visibly, the item disappears or gets clipped when it sits behind water or glass.

This is the same class of vanilla rendering bug ForceRender already tackles for frustum culling, and it shows up on custom display models (e.g. ItemsAdder furniture).

The fix

New ItemTranslucencyMixin mixes into RenderLayer#getItemEntityTranslucentCull — the render layer Minecraft uses to draw items in the world — and returns the equivalent getEntityCutout layer instead.

Cutout is alpha-tested and writes depth like an opaque surface, so items now resolve against translucent blocks correctly via the depth buffer. This is the least-invasive of the two possible approaches (the alternative being a much heavier mixin that reorders the translucent entity/block passes).

Trade-off: cutout loses soft alpha edges — each pixel is either fully drawn or discarded. This is imperceptible for the vast majority of item textures, and the behaviour can be turned off if soft transparency is specifically needed.

Config

Gated behind a new Fix Item Translucency toggle (default on), added to both forcerender.properties and the Mod Menu settings screen alongside the existing options.

Changes

  • mixin/ItemTranslucencyMixin.java — new client mixin (registered in forcerender.mixins.json)
  • ForceRenderConfig.java — new fixTranslucency option (load/save)
  • ForceRenderConfigScreen.java — new toggle button + label
  • ForceRenderMod.java — startup log includes the new option
  • fabric.mod.json — updated description
  • gradle.properties — version bump 1.1.0 → 1.2.0
  • README.md — documents the new fix, refreshed settings/compatibility tables

Version bumped to 1.2.0 (new user-facing feature, not just a patch).

Verification

The sandbox network policy blocks maven.fabricmc.net, so the mod can't be compiled locally here. Compilation — including Mixin annotation-processor validation of the injection target against the real 1.21.11 RenderLayer class — runs in the existing Build GitHub Actions workflow on this PR. Runtime/visual verification (item behind water/glass with the toggle on vs off) still needs a manual in-game check.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VaWtp4Tu17FEE4AtHU9hRo


Generated by Claude Code

Translucent entities (armor stands and the items they hold or wear) render
in a separate pass from translucent blocks such as water and glass. Vanilla
only depth-sorts render layers within each pass, never across them, so a
translucent item near a translucent block has no defined blend order and its
alpha pixels composite incorrectly — most visibly, the item disappears or is
clipped behind water/glass.

Add ItemTranslucencyMixin, which mixes into
RenderLayer#getItemEntityTranslucentCull (the layer used to draw items in the
world) and returns the equivalent getEntityCutout layer instead. Cutout is
alpha-tested and writes depth like an opaque surface, so items resolve against
translucent blocks correctly. The trade-off is loss of soft alpha edges, which
is imperceptible for the vast majority of item textures.

The behaviour is gated behind a new "Fix Item Translucency" toggle (default on)
in the config and Mod Menu screen, alongside the existing force-render options.

Bump mod version to 1.2.0 and refresh the README and mod metadata.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaWtp4Tu17FEE4AtHU9hRo
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a2ad106e-74cf-42f9-9305-0a30d163eba9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/translucent-entity-render-fix-3uudne

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

claude added 3 commits July 3, 2026 13:39
The fabric-loom 1.16-SNAPSHOT plugin now resolves to a build that requires
Gradle 9.4 (org.gradle.plugin.api-version=9.4.0), but the Build workflow
pinned Gradle 8.8, so dependency resolution failed before any compilation.
gradle-wrapper.properties already targets 9.4.0; align the CI workflow (and
the README build note) with it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaWtp4Tu17FEE4AtHU9hRo
RenderLayer#getEntityCutout(Identifier) does not exist in the 1.21.11 mappings;
the compile failed on it. Swap to getEntityCutoutNoCull(Identifier), a
long-stable entity cutout layer. NoCull also keeps back faces of 3D display
models visible, which suits the custom furniture models this targets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaWtp4Tu17FEE4AtHU9hRo
In 1.21.11 the render-layer factory methods moved out of RenderLayer and were
renamed. Intercept the two layers that actually draw items in the world:

  - TexturedRenderLayers#getItemTranslucentCull (block-atlas items) -> getEntityCutout
  - RenderLayers#itemEntityTranslucentCull(Identifier) (per-texture items) -> entityCutout

Both swaps keep the same texture and backface culling, changing only the pass
from translucent to depth-writing cutout so items composite correctly against
water and glass. Method/class names verified against the yarn 1.21.11 mappings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaWtp4Tu17FEE4AtHU9hRo
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.

2 participants