mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-08 08:11:14 +00:00
Fix z-fighting between feature previews and the bodies in the Design tab
The bodies now always draw over the preview on every face a feature leaves unchanged, for all features. Since a hole's cut sits inside the body, the Hole preview now hides the bodies and shows the result alone, as Fillet/Chamfer and Draft do.
This commit is contained in:
@@ -378,10 +378,14 @@ void DesignCanvas::reload(bool keep_view)
|
||||
v->set_color(c);
|
||||
}
|
||||
} else if (obj_idx == 1) {
|
||||
// The ghost is normally a faint blue overlay on the visible body. In preview-only
|
||||
// mode it IS the result (base bodies hidden), so render it opaque so it reads as a
|
||||
// finished solid rather than a see-through hint.
|
||||
// The ghost is the whole resulting model, normally drawn as a faint blue overlay on
|
||||
// the visible bodies. Every face the feature leaves alone is in both, at the same
|
||||
// depth, so the ghost is drawn with a depth bias: the bodies win on those faces instead
|
||||
// of the two copies z-fighting, and the ghost shows only where the result reaches past
|
||||
// the bodies. In preview-only mode it IS the result (base bodies hidden), so render it
|
||||
// opaque so it reads as a finished solid rather than a see-through hint.
|
||||
v->set_color(m_body_hidden ? ColorRGBA(0.40f, 0.82f, 1.0f, 1.0f) : ghost);
|
||||
v->depth_bias = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user