From 969718e03a7155390f929059d90b8173f4bb5084 Mon Sep 17 00:00:00 2001 From: DanS Date: Tue, 13 Oct 2026 13:30:20 -0500 Subject: [PATCH] perf(theme): drop the redundant acrylic grain under glass cards Glass cards draw their own grain layer over the surface overlay, but the acrylic primitive beneath them was also drawing its grain. That lower layer sits under the overlay at well below one grey level, so it is invisible and only costs an extra noise pass per card. - The card now asks the acrylic primitive for zero grain and keeps its own visible grain layer, removing the redundant pass with no visible change. Co-Authored-By: Claude Opus 4.8 --- src/ui/material/draw_helpers.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/material/draw_helpers.h b/src/ui/material/draw_helpers.h index c514ad3..ca4bfb2 100644 --- a/src/ui/material/draw_helpers.h +++ b/src/ui/material/draw_helpers.h @@ -741,9 +741,11 @@ inline void DrawGlassPanel(ImDrawList* dl, const ImVec2& pMin, // (skip the blur pass at 100% for performance) if (uiOp < 0.99f) { if (useAcrylic) { - const auto& acrylicTheme = GetCurrentAcrylicTheme(); - effects::ImGuiAcrylic::DrawAcrylicRect(dl, pMin, pMax, - acrylicTheme.card, spec.rounding); + // The card draws its own grain layer below (noise B, over the surface overlay), so skip + // the acrylic primitive's grain here: it sits under the overlay at < 1 grey level. + effects::AcrylicParams cardParams = GetCurrentAcrylicTheme().card; + cardParams.noiseOpacity = 0.0f; + effects::ImGuiAcrylic::DrawAcrylicRect(dl, pMin, pMax, cardParams, spec.rounding); } else { // Lightweight fake-glass: translucent fill ImU32 fill = (spec.fillAlpha == 18) ? s_glassFill : ScaleAlpha(s_glassFill, spec.fillAlpha / 18.0f);