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 <noreply@anthropic.com>
This commit is contained in:
@@ -233,7 +233,8 @@ fn fs_cloud(in: FullOut) -> CloudOut {
|
||||
let sndc = vec4<f32>(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<f32>(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<f32>(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);
|
||||
|
||||
Reference in New Issue
Block a user