[GH-ISSUE #4334] Shader API: the material stage cannot see what lies behind water or glass #1279

Closed
opened 2026-11-02 15:45:39 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Teiwazik on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4334

Originally assigned to: @Teiwazik on GitHub.

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

What

The material stage shades water, stained glass and ice from their own texture only: MaterialInput has no screen position, and the stage reads nothing but frame. A pack can't tint water by how deep it is, fade it to the bed in the shallows, or refract what lies behind it.

Proposal

Additively, within API 0.1:

  • MaterialInput.screen: the point's place on the screen, 0..1 from the top left.
  • opaque_depth and opaque_color in the material prelude: the world's depth and colour as solid terrain and entities left them, copied just before translucent terrain draws.

Related: #3734 asks for the same world-before-translucents for [[post]] passes, with a water mask; this is the material stage's side.

Originally created by @Teiwazik on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4334 Originally assigned to: @Teiwazik on GitHub. > 🤖 Filed by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally. ## What The material stage shades water, stained glass and ice from their own texture only: `MaterialInput` has no screen position, and the stage reads nothing but `frame`. A pack can't tint water by how deep it is, fade it to the bed in the shallows, or refract what lies behind it. ## Proposal Additively, within API 0.1: - `MaterialInput.screen`: the point's place on the screen, 0..1 from the top left. - `opaque_depth` and `opaque_color` in the material prelude: the world's depth and colour as solid terrain and entities left them, copied just before translucent terrain draws. Related: #3734 asks for the same world-before-translucents for `[[post]]` passes, with a water mask; this is the material stage's side.
Author
Owner

@Teiwazik commented on GitHub (Oct 30, 2026):

/claim

<!-- gh-comment-id:6520922689 --> @Teiwazik commented on GitHub (Oct 30, 2026): /claim
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#1279
No description provided.