mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-14 05:12:25 +08:00
fix: support shaders without textures (like flat), improves #184
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
parent
170af5ff7c
commit
bd5e452d34
@ -76,7 +76,14 @@ CEffect* CEffect::fromJSON (json data, CUserSettingBoolean* visible, CObject* ob
|
||||
if (textureNumber == 0) {
|
||||
auto* image = object->as<CImage> ();
|
||||
|
||||
texture = (*(*image->getMaterial ()->getPasses ().begin ())->getTextures ().begin ());
|
||||
auto passTextures = (*image->getMaterial ()->getPasses ().begin ())->getTextures ();
|
||||
|
||||
if (passTextures.empty ()) {
|
||||
// TODO: SET CHECKERBOARD TEXTURE AS DEFAULT IN THESE SITUATIONS
|
||||
texture = "";
|
||||
} else {
|
||||
texture = *passTextures.begin ();
|
||||
}
|
||||
} else {
|
||||
texture = "";
|
||||
}
|
||||
|
@ -257,12 +257,10 @@ CFBO* CWallpaper::createFBO (const std::string& name, ITexture::TextureFormat fo
|
||||
return fbo;
|
||||
}
|
||||
|
||||
void CWallpaper::aliasFBO(const std::string& alias, CFBO* original)
|
||||
{
|
||||
void CWallpaper::aliasFBO (const std::string& alias, CFBO* original) {
|
||||
this->m_fbos.insert (std::make_pair (alias, original));
|
||||
}
|
||||
|
||||
|
||||
const std::map<std::string, CFBO*>& CWallpaper::getFBOs () const {
|
||||
return this->m_fbos;
|
||||
}
|
||||
|
@ -519,7 +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));
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user