[PR #333] [MERGED] Shader packs design: Horizon WGSL packs and OptiFine/Iris translation #2500

Closed
opened 2026-11-02 15:56:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/333
Author: @ludovic111
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @ludovic111

Base: main ← Head: docs/shader-packs


📝 Commits (3)

  • 304ea50 Shader packs design: the renderer's passes, Horizon WGSL packs and Iris translation
  • eb466fe Shader packs: Iris translation spike results and implementation order
  • 047bf45 Shader packs doc: match the first slice (sun angle, folders)

📊 Changes

2 files changed (+332 additions, -0 deletions)

View changed files

📝 docs/README.md (+1 -0)
➕ docs/shader-packs.md (+331 -0)

📄 Description

What

docs/shader-packs.md (+ an index line in docs/README.md), the design doc for item 8/9 of the features plan:

  • How the renderer draws a frame today, pass by pass, with the files (gfx.rs world pass, gfx/world_post.rs, hand, screen_effects.rs, menu_blur.rs, post.rs, hud.rs) and the shared Globals uniform.
  • Horizon shader packs: shaderpacks/ (same folder as Iris), folder or zip, pack.toml manifest, options as WGSL override constants, stages (composite first; final, deferred, gbuffer, shadow planned), the bindings and the Frame uniform (camera, matrices, time, sun/moon, sky/fog colours, fog distances, weather, camera state, near/far), prelude helpers that hide reversed depth, hot reload (mtime polling + F3+T, keep last good pipelines on error), the Shader Packs screen (Video Settings, Iris-like), off by default with today's frame unchanged.
  • Java packs (OptiFine/Iris): what a pack contains, translation in four steps (Iris-style preprocessing, legalising compatibility-profile GLSL to 450 core, naga GLSL front end → WGSL, pipeline emulation), a difficulty table and the implementation order. Test set Complementary Reimagined, BSL, Sildur's Vibrant: development only, never committed or shipped (no-redistribution licences).

Spike results (second commit): naga 30 over Complementary Reimagined r5.9.3, BSL 10.1.8 and Sildur's Vibrant 2.02: raw naga parses 0 of 470 programs; after Iris-style preprocessing (pp-rs) and a legaliser, 464 parse and 450 (96%) validate and produce WGSL. The 20 left have three mechanical causes (matrix varyings, image formats, a naga front-end bug). Implementation order is in the doc. The spike tool stays outside the repo (a token rewriter; the real translator should rewrite a syntax tree).

Why

Ludovic wants players to bring their texture packs and shaders, and a new Horizon way to make shaders. This fixes the contract before the first code slice.

How tested

Docs only. Every file/pipeline name checked against origin/main (337ee470).

Needs Ludovic

Nothing; read the format if you want a say in pack.toml or the stage list before the first code slice lands.

🤖 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/333 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `docs/shader-packs` --- ### 📝 Commits (3) - [`304ea50`](https://github.com/horizon-rust/horizon/commit/304ea50a5f3ba41cd5bdd1e453d4c82a3133eb59) Shader packs design: the renderer's passes, Horizon WGSL packs and Iris translation - [`eb466fe`](https://github.com/horizon-rust/horizon/commit/eb466fe2d29c00739e18776e6da149066676d2fd) Shader packs: Iris translation spike results and implementation order - [`047bf45`](https://github.com/horizon-rust/horizon/commit/047bf45af12e5b869efbae5ef27e67bba189b92b) Shader packs doc: match the first slice (sun angle, folders) ### 📊 Changes **2 files changed** (+332 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/README.md` (+1 -0) ➕ `docs/shader-packs.md` (+331 -0) </details> ### 📄 Description ## What `docs/shader-packs.md` (+ an index line in `docs/README.md`), the design doc for item 8/9 of the features plan: - **How the renderer draws a frame today**, pass by pass, with the files (`gfx.rs` world pass, `gfx/world_post.rs`, hand, `screen_effects.rs`, `menu_blur.rs`, `post.rs`, `hud.rs`) and the shared `Globals` uniform. - **Horizon shader packs**: `shaderpacks/` (same folder as Iris), folder or zip, `pack.toml` manifest, options as WGSL `override` constants, stages (`composite` first; `final`, `deferred`, `gbuffer`, `shadow` planned), the bindings and the `Frame` uniform (camera, matrices, time, sun/moon, sky/fog colours, fog distances, weather, camera state, near/far), prelude helpers that hide reversed depth, hot reload (mtime polling + F3+T, keep last good pipelines on error), the Shader Packs screen (Video Settings, Iris-like), off by default with today's frame unchanged. - **Java packs (OptiFine/Iris)**: what a pack contains, translation in four steps (Iris-style preprocessing, legalising compatibility-profile GLSL to 450 core, naga GLSL front end → WGSL, pipeline emulation), a difficulty table and the implementation order. Test set Complementary Reimagined, BSL, Sildur's Vibrant: development only, never committed or shipped (no-redistribution licences). **Spike results** (second commit): naga 30 over Complementary Reimagined r5.9.3, BSL 10.1.8 and Sildur's Vibrant 2.02: raw naga parses 0 of 470 programs; after Iris-style preprocessing (pp-rs) and a legaliser, 464 parse and 450 (96%) validate and produce WGSL. The 20 left have three mechanical causes (matrix varyings, image formats, a naga front-end bug). Implementation order is in the doc. The spike tool stays outside the repo (a token rewriter; the real translator should rewrite a syntax tree). ## Why Ludovic wants players to bring their texture packs and shaders, and a new Horizon way to make shaders. This fixes the contract before the first code slice. ## How tested Docs only. Every file/pipeline name checked against `origin/main` (337ee470). ## Needs Ludovic Nothing; read the format if you want a say in `pack.toml` or the stage list before the first code slice lands. 🤖 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-02 15:56:42 +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#2500
No description provided.