[GH-ISSUE #3992] Reduce remaining per-pixel sunrise/sunset fan intersection work #1165

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

Originally created by @Vasysik on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3992

🤖 Filed by Vasysik's AI agent (OpenAI Codex, GPT-6), not by Vasysik personally.

The shared terrain.wgsl sunrise/sunset shader still scans 16 projected fan triangles per sky pixel after the CPU-normal optimization for #3143. A frozen, warmed scene on an Adreno 710 tablet remains substantially more GPU-bound at dawn, independently of chunk generation or uploads.

The proposed follow-up selects the relevant angular sectors without atan2, rejects rays on the wrong side of the fan, and retains the barycentric calculation and boundary/degenerate fallbacks. Geometry, colors and resolution remain unchanged.

The prepared upstream-only patch includes CPU and actual-WGSL GPU equivalence checks. Full Windows game smoke checks passed on RTX 4070 with Vulkan and DirectX 12, native Golden Hour, and the repository's classic ZIP fixture. Other vendors and operating systems remain untested.

🤖 Generated with OpenAI Codex.

Originally created by @Vasysik on GitHub (Oct 29, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3992 > 🤖 Filed by Vasysik's AI agent (OpenAI Codex, GPT-6), not by Vasysik personally. The shared `terrain.wgsl` sunrise/sunset shader still scans 16 projected fan triangles per sky pixel after the CPU-normal optimization for #3143. A frozen, warmed scene on an Adreno 710 tablet remains substantially more GPU-bound at dawn, independently of chunk generation or uploads. The proposed follow-up selects the relevant angular sectors without `atan2`, rejects rays on the wrong side of the fan, and retains the barycentric calculation and boundary/degenerate fallbacks. Geometry, colors and resolution remain unchanged. The prepared upstream-only patch includes CPU and actual-WGSL GPU equivalence checks. Full Windows game smoke checks passed on RTX 4070 with Vulkan and DirectX 12, native Golden Hour, and the repository's classic ZIP fixture. Other vendors and operating systems remain untested. 🤖 Generated with [OpenAI Codex](https://openai.com/codex/).
Author
Owner

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

🤖 Agent: /claim — Vasysik is contributing the prepared sunrise/sunset sector optimization. This comment retains the required agent attribution; the follow-up PR will link this issue.

<!-- gh-comment-id:6509236370 --> @Vasysik commented on GitHub (Oct 29, 2026): 🤖 Agent: /claim — Vasysik is contributing the prepared sunrise/sunset sector optimization. This comment retains the required agent attribution; the follow-up PR will link this issue.
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#1165
No description provided.