From 170af5ff7c157e1ded4dfe68942f2db33e5278f4 Mon Sep 17 00:00:00 2001 From: Alexis Maiquez Date: Thu, 14 Dec 2023 02:59:00 +0100 Subject: [PATCH] fix: black backgrounds on latest wallpaperengine version (g_Color4 was added) Signed-off-by: Alexis Maiquez --- src/WallpaperEngine/Render/CWallpaper.cpp | 8 ++++++++ src/WallpaperEngine/Render/CWallpaper.h | 7 +++++++ src/WallpaperEngine/Render/Objects/Effects/CPass.cpp | 1 + 3 files changed, 16 insertions(+) diff --git a/src/WallpaperEngine/Render/CWallpaper.cpp b/src/WallpaperEngine/Render/CWallpaper.cpp index 3faee58..df44c74 100644 --- a/src/WallpaperEngine/Render/CWallpaper.cpp +++ b/src/WallpaperEngine/Render/CWallpaper.cpp @@ -239,6 +239,8 @@ void CWallpaper::setupFramebuffers () { // create framebuffer for the scene this->m_sceneFBO = this->createFBO ("_rt_FullFrameBuffer", ITexture::TextureFormat::ARGB8888, clamp, 1.0, width, height, width, height); + + this->aliasFBO ("_rt_MipMappedFrameBuffer", this->m_sceneFBO); } CAudioContext& CWallpaper::getAudioContext () { @@ -255,6 +257,12 @@ CFBO* CWallpaper::createFBO (const std::string& name, ITexture::TextureFormat fo return fbo; } +void CWallpaper::aliasFBO(const std::string& alias, CFBO* original) +{ + this->m_fbos.insert (std::make_pair (alias, original)); +} + + const std::map& CWallpaper::getFBOs () const { return this->m_fbos; } diff --git a/src/WallpaperEngine/Render/CWallpaper.h b/src/WallpaperEngine/Render/CWallpaper.h index 07656fc..2942a0f 100644 --- a/src/WallpaperEngine/Render/CWallpaper.h +++ b/src/WallpaperEngine/Render/CWallpaper.h @@ -81,6 +81,13 @@ class CWallpaper : public Helpers::CContextAware { CFBO* createFBO (const std::string& name, ITexture::TextureFormat format, ITexture::TextureFlags flags, float scale, uint32_t realWidth, uint32_t realHeight, uint32_t textureWidth, uint32_t textureHeight); + /** + * Creates an alias of an existing fbo + * @param alias + * @param original + */ + void aliasFBO (const std::string& alias, CFBO* original); + /** * @return The full FBO list to work with */ diff --git a/src/WallpaperEngine/Render/Objects/Effects/CPass.cpp b/src/WallpaperEngine/Render/Objects/Effects/CPass.cpp index 17fd060..1239c07 100644 --- a/src/WallpaperEngine/Render/Objects/Effects/CPass.cpp +++ b/src/WallpaperEngine/Render/Objects/Effects/CPass.cpp @@ -519,6 +519,7 @@ void CPass::setupUniforms () { this->addUniform ("g_UserAlpha", this->m_material->getImage ()->getImage ()->getAlpha ()); this->addUniform ("g_Alpha", this->m_material->getImage ()->getImage ()->getAlpha ()); this->addUniform ("g_Color", this->m_material->getImage ()->getImage ()->getColor ()); + this->addUniform ("g_Color4", glm::vec4(this->m_material->getImage ()->getImage ()->getColor (), 1)); // TODO: VALIDATE THAT G_COMPOSITECOLOR REALLY COMES FROM THIS ONE this->addUniform ("g_CompositeColor", this->m_material->getImage ()->getImage ()->getColor ()); // add some external variables