diff --git a/src/MsdfAtlasLayerCombo.cpp b/src/MsdfAtlasLayerCombo.cpp index 4c9da49..9be529c 100644 --- a/src/MsdfAtlasLayerCombo.cpp +++ b/src/MsdfAtlasLayerCombo.cpp @@ -139,7 +139,7 @@ bool MsdfAtlasLayerCombo::hasChildren(){ } // unique -void MsdfAtlasLayerCombo::draw(){ +void MsdfAtlasLayerCombo::draw(bool fade){ OFX_PROFILER_FUNCTION() int elements = 0; for(const auto & layer : layers){ @@ -188,6 +188,7 @@ void MsdfAtlasLayerCombo::draw(){ //ofPopStyle(); msdfShader->begin(); + msdfShader->setUniform1f("fade", fade ? 1.0f : 0.0f); msdfShader->setUniform2f("unitRange", unitRange); msdfShader->setUniform4f("bgColor", bgColor); msdfShader->setUniformTexture("msdf", getAtlasImage().getTexture(), 0); diff --git a/src/MsdfAtlasLayerCombo.h b/src/MsdfAtlasLayerCombo.h index a25c0c7..288e0dd 100644 --- a/src/MsdfAtlasLayerCombo.h +++ b/src/MsdfAtlasLayerCombo.h @@ -21,7 +21,7 @@ class MsdfAtlasLayerCombo : public AtlasLayerCombo { const ComboIdentifier & getIdentifier() const override; void setVFlip(VFlipState vFlipState) override; bool hasChildren() override; - void draw(); + void draw(bool fade = true); void exit(); const ofImage & getAtlasImage(); string getAtlasImagePath();