summaryrefslogtreecommitdiff
path: root/src/render/pass
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-05-10 18:31:26 +0100
committerGitHub <noreply@github.com>2025-05-10 19:31:26 +0200
commitf58bb72d3a300dc482e9dc934101790c8707667d (patch)
tree8d05540c2dfa630241e016978437bf62023a7eee /src/render/pass
parent60cd5b7a48af4a23717201d70395161a3bb4ab24 (diff)
renderer: render blur on fade out (#10356)
Diffstat (limited to 'src/render/pass')
-rw-r--r--src/render/pass/TexPassElement.cpp19
-rw-r--r--src/render/pass/TexPassElement.hpp5
2 files changed, 19 insertions, 5 deletions
diff --git a/src/render/pass/TexPassElement.cpp b/src/render/pass/TexPassElement.cpp
index b27f1032..e6f4d052 100644
--- a/src/render/pass/TexPassElement.cpp
+++ b/src/render/pass/TexPassElement.cpp
@@ -11,10 +11,14 @@ CTexPassElement::CTexPassElement(const CTexPassElement::SRenderData& data_) : m_
void CTexPassElement::draw(const CRegion& damage) {
g_pHyprOpenGL->m_endFrame = m_data.flipEndFrame;
- CScopeGuard x = {[]() {
+ CScopeGuard x = {[this]() {
//
g_pHyprOpenGL->m_endFrame = false;
g_pHyprOpenGL->m_renderData.clipBox = {};
+ if (m_data.replaceProjection)
+ g_pHyprOpenGL->m_renderData.monitorProjection = g_pHyprOpenGL->m_renderData.pMonitor->m_projMatrix;
+ if (m_data.ignoreAlpha.has_value())
+ g_pHyprOpenGL->m_renderData.discardMode = 0;
}};
if (!m_data.clipBox.empty())
@@ -22,9 +26,16 @@ void CTexPassElement::draw(const CRegion& damage) {
if (m_data.replaceProjection)
g_pHyprOpenGL->m_renderData.monitorProjection = *m_data.replaceProjection;
- g_pHyprOpenGL->renderTextureInternalWithDamage(m_data.tex, m_data.box, m_data.a, m_data.damage.empty() ? damage : m_data.damage, m_data.round, m_data.roundingPower);
- if (m_data.replaceProjection)
- g_pHyprOpenGL->m_renderData.monitorProjection = g_pHyprOpenGL->m_renderData.pMonitor->m_projMatrix;
+
+ if (m_data.ignoreAlpha.has_value()) {
+ g_pHyprOpenGL->m_renderData.discardMode = DISCARD_ALPHA;
+ g_pHyprOpenGL->m_renderData.discardOpacity = *m_data.ignoreAlpha;
+ }
+
+ if (m_data.blur)
+ g_pHyprOpenGL->renderTextureWithBlur(m_data.tex, m_data.box, m_data.a, nullptr, m_data.round, m_data.roundingPower, false, m_data.blurA, 1.F);
+ else
+ g_pHyprOpenGL->renderTextureInternalWithDamage(m_data.tex, m_data.box, m_data.a, m_data.damage.empty() ? damage : m_data.damage, m_data.round, m_data.roundingPower);
}
bool CTexPassElement::needsLiveBlur() {
diff --git a/src/render/pass/TexPassElement.hpp b/src/render/pass/TexPassElement.hpp
index e98edd60..a9206d2d 100644
--- a/src/render/pass/TexPassElement.hpp
+++ b/src/render/pass/TexPassElement.hpp
@@ -11,13 +11,16 @@ class CTexPassElement : public IPassElement {
struct SRenderData {
SP<CTexture> tex;
CBox box;
- float a = 1.F;
+ float a = 1.F;
+ float blurA = 1.F;
CRegion damage;
int round = 0;
float roundingPower = 2.0f;
bool flipEndFrame = false;
std::optional<Mat3x3> replaceProjection;
CBox clipBox;
+ bool blur = false;
+ std::optional<float> ignoreAlpha;
};
CTexPassElement(const SRenderData& data);