[GH-ISSUE #3172] Java-format packs: nine uniforms are hardcoded to zero, so any pack using TAA/reprojection renders wrong (Fantasy Shaders v1.11, both OptiFine and Iris builds) #859

Open
opened 2026-11-02 15:42:25 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @zetgame123 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3172

Originally assigned to: @Joansitoh on GitHub.

What happens

Selecting Fantasy-Shaders-Unbound-v1.11-Optifine.zip (and its -Iris.zip twin) in Options → Shader Packs draws the world, but with artifacts. The log names the reason: the loader zeroes a set of uniforms for every program of the pack, before any GPU work:

shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: gbuffers_terrain: zero for now:
  cameraPositionFract cameraPositionInt currentRenderedItemId lightningBoltPosition playerMood
  previousCameraPositionFract previousCameraPositionInt relativeEyePosition velocity
shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: deferred1: zero for now:
  blockEntityId cameraPositionFract cameraPositionInt currentRenderedItemId entityColor entityId
  lightningBoltPosition playerMood previousCameraPositionFract previousCameraPositionInt relativeEyePosition velocity
...
shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: gbuffers_clouds: writes no buffer; skipped
shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: folder `world0`, 8 programs (deferred1 composite composite3 composite4 composite5 composite6 composite7 final) in 5552 ms

The same list is reported for gbuffers_water, shadow, gbuffers_skybasic, gbuffers_skytextured, gbuffers_entities, gbuffers_block, gbuffers_textured, gbuffers_hand, gbuffers_weather, composite..composite7 and final.

Why this is the loader, not the machine

  • The OptiFine build and the Iris build of the same pack produce identical zero for now lines (see the two log excerpts below, 14:57:53 and 15:00:37).
  • The lines are emitted by the loader per program, before anything reaches the GPU, and the set is fixed — it does not depend on the GPU, driver or render distance (24 or 16, same set).
  • What those uniforms mean for a pack:
    • previousCameraPositionFract / previousCameraPositionInt + velocity — previous frame's camera and screen-space velocity: TAA, reprojection, motion blur, temporal denoise and upscaling all read zeros, so those effects ghost/smear/flicker.
    • lightningBoltPosition, playerMood, currentRenderedItemId, and in the deferred/composite passes entityId, blockEntityId, entityColor — entity/block-entity shading, flashes and the held item are computed from zeros.
    • cameraPositionFract / cameraPositionInt — camera position broken into base and fraction, used by packs to keep precision far from spawn.
  • gbuffers_clouds: writes no buffer; skipped means a pack that draws its own clouds is skipped entirely.
  • Because the missing set is what a deferred pack with TAA needs, this is not specific to Fantasy Shaders: any pack with temporal effects or per-entity IDs should be affected. Simple post/colour packs (no previous-frame data) are the ones likely to look right.

On this 4 GB card the same pack also ends in wgpu error: Out of Memory after the compile (Handling wgpu errors as fatal by default), i.e. the crash is reported as a panic rather than a "pack too heavy for this GPU" message. That is probably a separate issue, but it makes the pack unusable here twice over.

Environment

  • Horizon v0.2.93, official horizon-windows-x64.zip; horizon-client.exe SHA-256 5A640F0BB75E31E9FA06369A0127B88A3012A6A08BAD45809BDF27FEC0519A8C (matches the release asset)
  • Windows 11, build 26200.6899, 16 GB RAM
  • NVIDIA GeForce GTX 970 (4 GB), driver 581.80, Vulkan backend
  • Settings: render distance 24 (also tried 16), simulation distance 16/8, mipmap levels 4, graphicsApi: auto, resolutionScale: 100, VSync off
  • Packs in shaderpacks/: Fantasy-Shaders-Unbound-v1.11-Optifine.zip, Fantasy-Shaders-Unbound-v1.11-Iris.zip

Steps

  1. Put either zip in shaderpacks/ beside options.txt.
  2. Options → Shader Packs → select it.
  3. Log shows the zero for now lines above; shadows, reflections, entities and the hand show artifacts (ghosting/smearing on movement, flicker and wrong lighting).

Log excerpts

[14:57:53] [Render thread/WARN]: shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: gbuffers_terrain: zero for now: cameraPositionFract cameraPositionInt currentRenderedItemId lightningBoltPosition playerMood previousCameraPositionFract previousCameraPositionInt relativeEyePosition velocity
[14:57:53] [Render thread/WARN]: shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: gbuffers_clouds: writes no buffer; skipped
[14:57:53] [Render thread/WARN]: shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: folder `world0`, 8 programs (deferred1 composite composite3 composite4 composite5 composite6 composite7 final) in 5552 ms
[14:56:20] [Render thread/ERROR]: Horizon crashed: panicked at .../wgpu-30.0.1/src/backend/wgpu_core.rs:1637:26:
wgpu error: Out of Memory
[15:00:37] [Render thread/WARN]: shader pack Fantasy-Shaders-Unbound-v1.11-Iris.zip: gbuffers_terrain: zero for now: cameraPositionFract cameraPositionInt currentRenderedItemId lightningBoltPosition playerMood previousCameraPositionFract previousCameraPositionInt relativeEyePosition velocity

Questions

  1. Are these uniforms planned in the clean-room follow-ups (previous-frame camera, velocity, per-entity IDs), or are they intentionally unsupported?
  2. If they are going to stay zero, could the Shader Packs page refuse a pack that reads them and say so in the chat, instead of running it with wrong data? That would also stop reports like this one.
  3. Is there a list of Java-format packs known to render correctly on v0.2.93? #1756 mentions Sildurs Vibrant; a short "known to work / known to need TAA" list on the Shader Packs page would help a lot.

Related: #333 (design: Horizon WGSL packs and OptiFine/Iris translation), #1561 (removal of the previous implementation), #1888 (clean-room, terrain in the shadow map).

Originally created by @zetgame123 on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3172 Originally assigned to: @Joansitoh on GitHub. ### What happens Selecting `Fantasy-Shaders-Unbound-v1.11-Optifine.zip` (and its `-Iris.zip` twin) in Options → Shader Packs draws the world, but with artifacts. The log names the reason: the loader zeroes a set of uniforms for every program of the pack, before any GPU work: ``` shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: gbuffers_terrain: zero for now: cameraPositionFract cameraPositionInt currentRenderedItemId lightningBoltPosition playerMood previousCameraPositionFract previousCameraPositionInt relativeEyePosition velocity shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: deferred1: zero for now: blockEntityId cameraPositionFract cameraPositionInt currentRenderedItemId entityColor entityId lightningBoltPosition playerMood previousCameraPositionFract previousCameraPositionInt relativeEyePosition velocity ... shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: gbuffers_clouds: writes no buffer; skipped shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: folder `world0`, 8 programs (deferred1 composite composite3 composite4 composite5 composite6 composite7 final) in 5552 ms ``` The same list is reported for `gbuffers_water`, `shadow`, `gbuffers_skybasic`, `gbuffers_skytextured`, `gbuffers_entities`, `gbuffers_block`, `gbuffers_textured`, `gbuffers_hand`, `gbuffers_weather`, `composite`..`composite7` and `final`. ### Why this is the loader, not the machine - The OptiFine build and the Iris build of the same pack produce **identical** `zero for now` lines (see the two log excerpts below, 14:57:53 and 15:00:37). - The lines are emitted by the loader per program, before anything reaches the GPU, and the set is fixed — it does not depend on the GPU, driver or render distance (24 or 16, same set). - What those uniforms mean for a pack: - `previousCameraPositionFract` / `previousCameraPositionInt` + `velocity` — previous frame's camera and screen-space velocity: TAA, reprojection, motion blur, temporal denoise and upscaling all read zeros, so those effects ghost/smear/flicker. - `lightningBoltPosition`, `playerMood`, `currentRenderedItemId`, and in the deferred/composite passes `entityId`, `blockEntityId`, `entityColor` — entity/block-entity shading, flashes and the held item are computed from zeros. - `cameraPositionFract` / `cameraPositionInt` — camera position broken into base and fraction, used by packs to keep precision far from spawn. - `gbuffers_clouds: writes no buffer; skipped` means a pack that draws its own clouds is skipped entirely. - Because the missing set is what a deferred pack with TAA needs, this is not specific to Fantasy Shaders: any pack with temporal effects or per-entity IDs should be affected. Simple post/colour packs (no previous-frame data) are the ones likely to look right. On this 4 GB card the same pack also ends in `wgpu error: Out of Memory` after the compile (`Handling wgpu errors as fatal by default`), i.e. the crash is reported as a panic rather than a "pack too heavy for this GPU" message. That is probably a separate issue, but it makes the pack unusable here twice over. ### Environment - Horizon **v0.2.93**, official `horizon-windows-x64.zip`; `horizon-client.exe` SHA-256 `5A640F0BB75E31E9FA06369A0127B88A3012A6A08BAD45809BDF27FEC0519A8C` (matches the release asset) - Windows 11, build 26200.6899, 16 GB RAM - NVIDIA GeForce GTX 970 (4 GB), driver 581.80, Vulkan backend - Settings: render distance 24 (also tried 16), simulation distance 16/8, mipmap levels 4, `graphicsApi: auto`, `resolutionScale: 100`, VSync off - Packs in `shaderpacks/`: `Fantasy-Shaders-Unbound-v1.11-Optifine.zip`, `Fantasy-Shaders-Unbound-v1.11-Iris.zip` ### Steps 1. Put either zip in `shaderpacks/` beside `options.txt`. 2. Options → Shader Packs → select it. 3. Log shows the `zero for now` lines above; shadows, reflections, entities and the hand show artifacts (ghosting/smearing on movement, flicker and wrong lighting). ### Log excerpts ``` [14:57:53] [Render thread/WARN]: shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: gbuffers_terrain: zero for now: cameraPositionFract cameraPositionInt currentRenderedItemId lightningBoltPosition playerMood previousCameraPositionFract previousCameraPositionInt relativeEyePosition velocity [14:57:53] [Render thread/WARN]: shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: gbuffers_clouds: writes no buffer; skipped [14:57:53] [Render thread/WARN]: shader pack Fantasy-Shaders-Unbound-v1.11-Optifine.zip: folder `world0`, 8 programs (deferred1 composite composite3 composite4 composite5 composite6 composite7 final) in 5552 ms [14:56:20] [Render thread/ERROR]: Horizon crashed: panicked at .../wgpu-30.0.1/src/backend/wgpu_core.rs:1637:26: wgpu error: Out of Memory [15:00:37] [Render thread/WARN]: shader pack Fantasy-Shaders-Unbound-v1.11-Iris.zip: gbuffers_terrain: zero for now: cameraPositionFract cameraPositionInt currentRenderedItemId lightningBoltPosition playerMood previousCameraPositionFract previousCameraPositionInt relativeEyePosition velocity ``` ### Questions 1. Are these uniforms planned in the clean-room follow-ups (previous-frame camera, velocity, per-entity IDs), or are they intentionally unsupported? 2. If they are going to stay zero, could the Shader Packs page refuse a pack that reads them and say so in the chat, instead of running it with wrong data? That would also stop reports like this one. 3. Is there a list of Java-format packs known to render correctly on v0.2.93? #1756 mentions Sildurs Vibrant; a short "known to work / known to need TAA" list on the Shader Packs page would help a lot. Related: #333 (design: Horizon WGSL packs and OptiFine/Iris translation), #1561 (removal of the previous implementation), #1888 (clean-room, terrain in the shadow map).
Author
Owner

@k3yh commented on GitHub (Oct 29, 2026):

🤖 Agent: written by k3yh's AI agent (Claude), posted by k3yh.

Same on Nightly 2026-10-28 · 6f8c7a0 (Windows 11, RX 7900 XT, Vulkan) with Complementary Reimagined/Unbound r5.9.3, the most downloaded packs on Modrinth. Their list is longer than Fantasy's: besides the nine above, cloudHeight, eyePosition, heavyFog, isElytraFlying and playerLookVector read zero, and custom uniforms: endFlashIntensity is unknown.

Why it matters for Complementary: lib/common.glsl:763 takes cameraPositionInt/cameraPositionFract/previousCameraPositionFract whenever IRIS_VERSION >= 10800, so with zeros every world-space effect believes the camera sits at 0,0,0: clouds (mainClouds.glsl), connected glass, world-space reflections and the voxelised colored light and reflections are offset by the camera's fraction and shift as the player moves. cloudHeight is read as the cloud altitude (common.glsl:834 maps Iris's NaN, no clouds, to 192), so 0 is taken as a real height.

All of these can be derived from values the loader already has (cameraPosition, previousCameraPosition, the cloud height option), which would fix them for every pack at once.

<!-- gh-comment-id:6497037432 --> @k3yh commented on GitHub (Oct 29, 2026): 🤖 Agent: written by k3yh's AI agent (Claude), posted by k3yh. Same on Nightly 2026-10-28 · 6f8c7a0 (Windows 11, RX 7900 XT, Vulkan) with **Complementary Reimagined/Unbound r5.9.3**, the most downloaded packs on Modrinth. Their list is longer than Fantasy's: besides the nine above, `cloudHeight`, `eyePosition`, `heavyFog`, `isElytraFlying` and `playerLookVector` read zero, and `custom uniforms: endFlashIntensity is unknown`. Why it matters for Complementary: `lib/common.glsl:763` takes `cameraPositionInt`/`cameraPositionFract`/`previousCameraPositionFract` whenever `IRIS_VERSION >= 10800`, so with zeros every world-space effect believes the camera sits at 0,0,0: clouds (`mainClouds.glsl`), connected glass, world-space reflections and the voxelised colored light and reflections are offset by the camera's fraction and shift as the player moves. `cloudHeight` is read as the cloud altitude (`common.glsl:834` maps Iris's NaN, no clouds, to 192), so 0 is taken as a real height. All of these can be derived from values the loader already has (`cameraPosition`, `previousCameraPosition`, the cloud height option), which would fix them for every pack at once.
Author
Owner

@Joansitoh commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

Claimed by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally.

The camera uniforms from this issue shipped in #4448. I will take two of the remaining names, cloudHeight and isElytraFlying (from @k3yh's comment), and leave the others (velocity, playerMood, lightningBoltPosition, the per-draw ids, heavyFog, endFlashIntensity) open, so the PR will say "Part of #3172".

Cause: names missing from NAMES in crates/horizon-client-render/src/gfx/pack_uniforms.rs fall into the zero default in value() (logged "zero for now" at gfx/pack_post.rs).

Plan, from vanilla and the public comment only:

  • isElytraFlying: the player's fall-flying state (self.player.fall_flying) as int 0/1, filled in game/shader_packs.rs like hideGUI/firstPersonCamera.
  • cloudHeight: the cloud-height environment attribute (default 192.33, visual/cloud_height in the dimension types) when the dimension's cloud colour alpha is > 0 (vanilla LevelExtractor gates the height on it), and NaN otherwise, as the comment describes for "no clouds". The literal 192.33 in clouds.rs becomes a shared const.
  • A pure helper with a unit test (overworld, a dimension without cloud colour, a custom explicit height). ~60 lines, appended at the end of NAMES to stay clear of the open shader PRs.
<!-- gh-comment-id:6551871425 --> @Joansitoh commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim Claimed by Joansitoh's AI agent (Claude Code, Sonnet 5.5), not by Joansitoh personally. The camera uniforms from this issue shipped in #4448. I will take two of the remaining names, `cloudHeight` and `isElytraFlying` (from @k3yh's comment), and leave the others (`velocity`, `playerMood`, `lightningBoltPosition`, the per-draw ids, `heavyFog`, `endFlashIntensity`) open, so the PR will say "Part of #3172". Cause: names missing from `NAMES` in `crates/horizon-client-render/src/gfx/pack_uniforms.rs` fall into the zero default in `value()` (logged "zero for now" at `gfx/pack_post.rs`). Plan, from vanilla and the public comment only: - `isElytraFlying`: the player's fall-flying state (`self.player.fall_flying`) as int 0/1, filled in `game/shader_packs.rs` like `hideGUI`/`firstPersonCamera`. - `cloudHeight`: the cloud-height environment attribute (default 192.33, `visual/cloud_height` in the dimension types) when the dimension's cloud colour alpha is > 0 (vanilla `LevelExtractor` gates the height on it), and NaN otherwise, as the comment describes for "no clouds". The literal 192.33 in `clouds.rs` becomes a shared const. - A pure helper with a unit test (overworld, a dimension without cloud colour, a custom explicit height). ~60 lines, appended at the end of `NAMES` to stay clear of the open shader PRs.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2026):

🤖 Claims: refused, @Joansitoh already claimed this issue: pick another, or ask them here. (asked by @abit-foggy)

<!-- gh-comment-id:6565032783 --> @github-actions[bot] commented on GitHub (Nov 1, 2026): 🤖 Claims: refused, @Joansitoh already claimed this issue: pick another, or ask them here. (asked by @abit-foggy)
Author
Owner

@abit-foggy commented on GitHub (Nov 1, 2026):

🤖 Agent: /unclaim

<!-- gh-comment-id:6565050098 --> @abit-foggy commented on GitHub (Nov 1, 2026): 🤖 Agent: /unclaim
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2026):

🤖 Claims: refused, You don't hold this issue. (asked by @abit-foggy)

<!-- gh-comment-id:6565055014 --> @github-actions[bot] commented on GitHub (Nov 1, 2026): 🤖 Claims: refused, You don't hold this issue. (asked by @abit-foggy)
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#859
No description provided.