From 32f616192149fa9247ad1abdc7af611db0ebe237 Mon Sep 17 00:00:00 2001 From: chexit Date: Fri, 30 Oct 2026 19:07:37 +0300 Subject: [PATCH] HD clouds: rays from a far point, so the view bob's eye offset does not bend them Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/gfx/hd/cloud.wgsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/gfx/hd/cloud.wgsl b/crates/horizon-client/src/gfx/hd/cloud.wgsl index 18aac24f6..abe69df78 100644 --- a/crates/horizon-client/src/gfx/hd/cloud.wgsl +++ b/crates/horizon-client/src/gfx/hd/cloud.wgsl @@ -233,7 +233,8 @@ fn fs_cloud(in: FullOut) -> CloudOut { let sndc = vec4(suv.x * 2.0 - 1.0, 1.0 - suv.y * 2.0, max(zmax, 0.000001), 1.0); let sh = frame.inverse_view_proj * sndc; let scene_len = select(SKY_LEN, length(sh.xyz / sh.w), zmax > 0.0); - let ndc = vec4(in.uv.x * 2.0 - 1.0, 1.0 - in.uv.y * 2.0, 0.5, 1.0); + // A far point: the view bob offsets the eye, and from a point 10 cm away (depth 0.5) that bends the ray. + let ndc = vec4(in.uv.x * 2.0 - 1.0, 1.0 - in.uv.y * 2.0, 0.0005, 1.0); let hh = frame.inverse_view_proj * ndc; let dir = normalize(hh.xyz / hh.w); let m = march_cumulus(dir, scene_len, ign(in.position.xy), false);