bug: renderRect blur not clipped by rounding #13612
|
Replies: 3 comments 2 replies
|
Related and/or possible dupe of: Bisected to the same commit. EDIT: See also #12024 for when those rectangles were fixed. |
|
This bug is still there, isn't it? |
|
This appears to fix the problem on my end. I'm doing the same thing renderTextureWithBlurInternal does i.e. calculating the monitor space box to set the UV on the blur texture. However, I'm hesitant on opening a PR cause 1) I can't understand why this wasn't necessary before, and 2) I'm not sure this doesn't conflict with anything. Wish someone would give this a look diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 31a6928e..1fbce27c 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -1056,8 +1056,31 @@ void CHyprOpenGLImpl::renderRectWithBlurInternal(const CBox& box, const CHyprCol
g_pHyprRenderer->pushMonitorTransformEnabled(true);
const auto SAVEDRENDERMODIF = g_pHyprRenderer->m_renderData.renderModif;
g_pHyprRenderer->m_renderData.renderModif = {}; // fix shit
- renderTexture(blurredBG, MONITORBOX,
- STextureRenderData{.damage = &damage, .a = data.blurA, .round = data.round, .roundingPower = 2.F, .allowCustomUV = false, .allowDim = false, .noAA = false});
+
+ auto& m_renderData = g_pHyprRenderer->m_renderData;
+
+ CBox transformedBox = box;
+ transformedBox.transform(Math::wlTransformToHyprutils(Math::invertTransform(m_renderData.pMonitor->m_transform)), m_renderData.pMonitor->m_transformedSize.x,
+ m_renderData.pMonitor->m_transformedSize.y);
+
+ CBox monitorSpaceBox = {transformedBox.pos().x / m_renderData.pMonitor->m_pixelSize.x * m_renderData.pMonitor->m_transformedSize.x,
+ transformedBox.pos().y / m_renderData.pMonitor->m_pixelSize.y * m_renderData.pMonitor->m_transformedSize.y,
+ transformedBox.width / m_renderData.pMonitor->m_pixelSize.x * m_renderData.pMonitor->m_transformedSize.x,
+ transformedBox.height / m_renderData.pMonitor->m_pixelSize.y * m_renderData.pMonitor->m_transformedSize.y};
+
+ renderTexture(blurredBG, box,
+ STextureRenderData{
+ .damage = &damage,
+ .a = data.blurA,
+ .round = data.round,
+ .roundingPower = data.roundingPower,
+ .allowCustomUV = true,
+ .allowDim = false,
+ .noAA = false,
+ .primarySurfaceUVTopLeft = monitorSpaceBox.pos() / m_renderData.pMonitor->m_transformedSize,
+ .primarySurfaceUVBottomRight = (monitorSpaceBox.pos() + monitorSpaceBox.size()) / m_renderData.pMonitor->m_transformedSize,
+ });
+
g_pHyprRenderer->popMonitorTransformEnabled();
g_pHyprRenderer->m_renderData.renderModif = SAVEDRENDERMODIF;
EDIT: in the meanwhile, I've implemented this as a plugin here https://github.com/giacomozama/renderrect-blur-fix |


This appears to fix the problem on my end. I'm doing the same thing renderTextureWithBlurInternal does i.e. calculating the monitor space box to set the UV on the blur texture.
However, I'm hesitant on opening a PR cause 1) I can't understand why this wasn't necessary before, and 2) I'm not sure this doesn't conflict with anything.
Wish someone would give this a look