Improve model bounds debug draw for better depth-readability of occluded pixels

This commit is contained in:
2026-08-10 06:04:27 +02:00
parent 5b648b1824
commit 716f665e39
3 changed files with 13 additions and 2 deletions
@@ -405,7 +405,7 @@ namespace FlaxEditor.Viewport.Previews
// Draw bounds
if (_showBounds)
{
DebugDraw.DrawWireBox(_previewModel.Box, Color.Violet.RGBMultiplied(0.8f), 0, false);
DebugDrawBounds(_previewModel.Box);
}
}
@@ -224,6 +224,17 @@ namespace FlaxEditor.Viewport.Previews
}
}
/// <summary>
/// Draws the bounds of object.
/// </summary>
/// <param name="box">Object bounding box.</param>
protected void DebugDrawBounds(BoundingBox box)
{
var color = Color.Violet.RGBMultiplied(0.8f);
DebugDraw.DrawWireBox(box, color.AlphaMultiplied(0.3f), 0, false);
DebugDraw.DrawWireBox(box, color, 0, true);
}
/// <summary>
/// Called when drawing debug shapes with <see cref="DebugDraw"/> for this viewport.
/// </summary>
@@ -302,7 +302,7 @@ namespace FlaxEditor.Viewport.Previews
// Draw bounds
if (_showBounds)
{
DebugDraw.DrawWireBox(_previewModel.Box, Color.Violet.RGBMultiplied(0.8f), 0, false);
DebugDrawBounds(_previewModel.Box);
}
// Draw normals