renderer: render blur on fade out (#10356)
This commit is contained in:
parent
60cd5b7a48
commit
f58bb72d3a
8 changed files with 90 additions and 45 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue