fix(renderer): keep draw-order offsets within clipping planes

This commit is contained in:
Christopher Overbeck committed 2026-09-15 12:36:05 -05:00
1 parent 0e42e3bf28
commit e52e565b1f
26 files changed
+525 -90

No files matched your search

+1 -4
View File
@@ -32,16 +32,13 @@ struct VertOut {
@location(1) color: vec4<f32>,
}
const DRAW_ORDER_BIAS: f32 = 0.001;
@vertex
fn vs_main(v: VertIn) -> VertOut {
var out: VertOut;
let rel = (v.pos + v.translation - u.eye_high)
+ (v.pos_low + v.translation_low - u.eye_low);
out.clip_pos = u.view_rot * vec4<f32>(rel, 1.0);
out.clip_pos.z = out.clip_pos.z
- (v.source_depth + v.instance_depth) * DRAW_ORDER_BIAS * out.clip_pos.w;
out.clip_pos = apply_draw_order(out.clip_pos, v.source_depth + v.instance_depth);
out.uv = v.uv;
out.color = v.color;
return out;