forked from 1b-agent/opencadstudio-upstream
fix(render): draw command-preview wires always on top
Preview / interim / grip-drag overlay wires were drawn in the main wire pass with the depth-tested wire_pipeline (depth_compare=LessEqual), so a live command preview could be hidden behind occluding geometry — a 3D solid, or 2D geometry drawn in front of it. Draw them with the existing wire_xray_pipeline instead (depth_compare= Always, no depth write), the same always-on-top path selection highlights already use. Previews are now never occluded, for every command. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
c7ecabffb7
commit
34e750407b
1 file changed
+12
-6
@@ -1676,12 +1676,18 @@ impl Pipeline {
|
||||
if scissor_active {
|
||||
pass.set_scissor_rect(0, 0, vp.width, vp.height);
|
||||
}
|
||||
// Live overlay wires (command preview / interim / grip drag) on top
|
||||
// of the base pass, same pipeline + depth test. No scissor.
|
||||
for pw in &self.gpu_preview_wires {
|
||||
if pw.instance_count > 0 {
|
||||
pass.set_vertex_buffer(0, pw.instance_buffer.slice(..));
|
||||
pass.draw(0..6, 0..pw.instance_count);
|
||||
// Live overlay wires (command preview / interim / grip drag) always
|
||||
// on top: the xray pipeline (depth_compare=Always, no depth write)
|
||||
// keeps them visible through any occluding geometry — a 3D solid, or
|
||||
// 2D geometry drawn in front — so a command preview is never hidden.
|
||||
// No scissor.
|
||||
if self.gpu_preview_wires.iter().any(|pw| pw.instance_count > 0) {
|
||||
pass.set_pipeline(&self.wire_xray_pipeline);
|
||||
for pw in &self.gpu_preview_wires {
|
||||
if pw.instance_count > 0 {
|
||||
pass.set_vertex_buffer(0, pw.instance_buffer.slice(..));
|
||||
pass.draw(0..6, 0..pw.instance_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user