Skip to content

Fix redstone dust transparent pixels rendered as reflective surface - #24

Open
AzusaKe wants to merge 1 commit into
ComfyFluffy:mainfrom
AzusaKe:fix/redstone-transparency
Open

Fix redstone dust transparent pixels rendered as reflective surface#24
AzusaKe wants to merge 1 commit into
ComfyFluffy:mainfrom
AzusaKe:fix/redstone-transparency

Conversation

@AzusaKe

@AzusaKe AzusaKe commented Jul 20, 2026

Copy link
Copy Markdown

Fixes #20

Problem

Minecraft 26.2 classifies RedStoneWireBlock as TRANSLUCENT instead of CUTOUT. This causes redstone dust quads to land in the translucent geometry bucket, which has no any-hit shader for radiance rays. Transparent pixels are not discarded by alpha cutout and render as opaque reflective surfaces.

Root Cause

In RtTerrainMesher, the chunk layer from quad.chunkLayer() determines which geometry bucket a quad enters:

  • SOLID → opaque bucket (no any-hit)
  • CUTOUT → cutout bucket (any-hit with alpha cutoff)
  • TRANSLUCENT → translucent bucket (shadow-only any-hit, radiance rays skip alpha test)

Redstone wire is an alpha-tested cutout block (transparent background, opaque wire) but Minecraft 26.2 reports its layer as TRANSLUCENT. This puts it in the translucent bucket where the any-hit shader never runs for radiance rays, so transparent pixels pass through to the closest-hit shader and render as solid surfaces.

Fix

Override the chunk layer to CUTOUT for RedStoneWireBlock in the mesher, so its quads enter the cutout bucket where the standard alpha-test any-hit shader handles them. Genuine translucent blocks (glass, ice) are unaffected.

Note: This PR was partially developed with AI assistance (code analysis, root cause identification, and implementation). Please review carefully — particularly the instanceof RedStoneWireBlock approach and whether a more general solution for other blocks with the same chunk-layer misclassification is preferred.

Minecraft 26.2 classifies RedStoneWireBlock as TRANSLUCENT instead of
CUTOUT, causing its quads to land in the translucent geometry bucket
which has no any-hit shader for radiance rays. Transparent pixels are
not discarded and render as opaque reflective surfaces.

Override the chunk layer to CUTOUT for RedStoneWireBlock so its quads
enter the cutout bucket where the standard alpha-test any-hit shader
handles them. Genuine translucent blocks (glass, ice) are unaffected.
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.

Redstone dust transparent pixels are rendered as a reflective surface

1 participant