Files
horizon-airdef/crates/horizon-client/src/border.wgsl
T
Ludovic Marie 8a32850f95 Lay out the player list exactly as vanilla PlayerTabOverlay does
tab_list ports PlayerTabOverlay: the comparator (list order, spectators,
team, name ignoring case), the 80-player limit and 20-row columns, heads
with the default skin by UUID and upside-down names, team and spectator
name styling, ping bars, the list objective as integer scores in their
number format or hearts with their change blink and the hp text fallback,
and the wrapped header and footer. Font::split_lines now follows
StringSplitter.splitLines and Text::resolve_legacy applies legacy codes
inside components. test_tab_list_parity runs vanilla's overlay against
examples/tab_list_fixture: 1,000 cases, 3,476 frames, 844,758 calls match.

The protocol gains the scoreboard, team and world border packets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:47:55 +02:00

33 lines
1.1 KiB
WebGPU Shading Language

// The world border wall (core/world_border): camera-relative wall quads
// moved by the model offset, the forcefield texture scrolled by the texture
// offset and modulated by the status colour and fade.
struct Globals {
view_proj: mat4x4<f32>,
}
struct Border {
color: vec4<f32>,
// xyz: model offset, w: texture translation (u and v)
offset: vec4<f32>,
}
@group(0) @binding(0) var<uniform> globals: Globals;
@group(0) @binding(1) var forcefield: texture_2d<f32>;
@group(0) @binding(2) var forcefield_sampler: sampler;
@group(0) @binding(3) var<uniform> border: Border;
struct Out {
@builtin(position) clip: vec4<f32>,
@location(0) uv: vec2<f32>,
}
@vertex fn vs_border(@location(0) position: vec3<f32>, @location(1) uv: vec2<f32>) -> Out {
var out: Out;
out.clip = globals.view_proj * vec4(position + border.offset.xyz, 1.0);
out.uv = uv + vec2(border.offset.w);
return out;
}
@fragment fn fs_border(in: Out) -> @location(0) vec4<f32> {
let color = textureSample(forcefield, forcefield_sampler, in.uv);
if color.a == 0.0 {
discard;
}
return color * border.color;
}