fix(gui): add frosted-glass blur behind PanelClickGui panel and search bar
The panel and search-bar backgrounds were calling TextGlow.drawBackground only, which paints two translucent rounded rects (a dark base + a thin white overlay). The original visual is supposed to be a frosted-glass blur of the gameplay behind it -- the blur shader was loaded and wired up via RenderUtil.drawBlurredRect (blits the main render target into a TextureTarget, then samples it through the 'blur' shader from ShaderSource), but nothing was actually invoking it. Call RenderUtil.drawBlurredRect right before TextGlow.drawBackground in both drawPanelGlow and drawSearchBar, using the existing radius and effective alpha so the blur fades in alongside the panel open animation. The shader assets (blur.fsh / blur.vsh / common.glsl) are embedded in ShaderSource enum, so no extra resource files are needed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -190,7 +190,9 @@ extends Screen {
|
||||
private void drawPanelGlow(GuiGraphics guiGraphics, int panelX, int panelY, float partialTicks, float alpha) {
|
||||
int panelWidth = (int)(600.0f * this.currentScale);
|
||||
int panelHeight = (int)(400.0f * this.currentScale);
|
||||
TextGlow.drawBackground(guiGraphics.pose(), panelX, panelY, panelWidth, panelHeight, 12.0f * this.currentScale, alpha);
|
||||
float radius = 12.0f * this.currentScale;
|
||||
RenderUtil.drawBlurredRect(guiGraphics.pose(), panelX, panelY, panelWidth, panelHeight, radius, 8.0f, alpha, 0);
|
||||
TextGlow.drawBackground(guiGraphics.pose(), panelX, panelY, panelWidth, panelHeight, radius, alpha);
|
||||
}
|
||||
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int button) {
|
||||
@@ -375,7 +377,9 @@ extends Screen {
|
||||
int searchHeight = (int)(20.0f * this.currentScale);
|
||||
int searchX = panelX + (panelWidth - searchWidth) / 2;
|
||||
int searchY = panelY + panelHeight + (int)(15.0f * this.currentScale);
|
||||
TextGlow.drawBackground(guiGraphics.pose(), searchX, searchY, searchWidth, searchHeight, 8.0f * this.currentScale, alpha);
|
||||
float searchRadius = 8.0f * this.currentScale;
|
||||
RenderUtil.drawBlurredRect(guiGraphics.pose(), searchX, searchY, searchWidth, searchHeight, searchRadius, 8.0f, alpha, 0);
|
||||
TextGlow.drawBackground(guiGraphics.pose(), searchX, searchY, searchWidth, searchHeight, searchRadius, alpha);
|
||||
Renderer.renderConsumer((drawContext -> {
|
||||
FontRenderer iconFont = FontPresets.materialIcons(20.0f * this.currentScale);
|
||||
String iconText = "\uE8B6";
|
||||
|
||||
Reference in New Issue
Block a user