// Sky Backdrop + 3D Debug Lines Shader (Tracers, Tactical Order Lines, F3 Acoustic Bounce Rays) @group(0) @binding(0) var u: GlobalUniforms; struct SkyOut { @builtin(position) position: vec4, @location(0) uv: vec2, }; @vertex fn vs_sky(@builtin(vertex_index) vid: u32) -> SkyOut { var out: SkyOut; let x = f32(i32(vid & 1u) * 4 - 1); let y = f32(i32(vid >> 1u) * 4 - 1); out.position = vec4(x, y, 0.99999, 1.0); out.uv = vec2(x * 0.5 + 0.5, -y * 0.5 + 0.5); return out; } @fragment fn fs_sky(in: SkyOut) -> @location(0) vec4 { let ndc = vec2(in.uv.x * 2.0 - 1.0, -(in.uv.y * 2.0 - 1.0)); let world_far = u.inv_view_proj * vec4(ndc, 1.0, 1.0); let dir = normalize(world_far.xyz / world_far.w - u.camera_pos.xyz); let col = eval_winter_sky(dir, normalize(u.sun_dir.xyz), u.sun_dir.w); return vec4(col, 1.0); } struct LineIn { @location(0) position: vec3, @location(1) color: vec4, }; struct LineOut { @builtin(position) position: vec4, @location(0) color: vec4, }; @vertex fn vs_line(v: LineIn) -> LineOut { var out: LineOut; out.position = u.view_proj * vec4(v.position, 1.0); out.color = v.color; return out; } @fragment fn fs_line(in: LineOut) -> @location(0) vec4 { return in.color; }