在openFrameworks中,是否可以在使用ofxPiMapper时更改fbo源的不透明度?
想
通了:
进入插件/ofxPiMapper/src/Surfaces/SurfaceStack.cpp在 SurfaceStack::d raw() 中,将 ofEnableAlphaBlending() 添加到 for 循环内的 if 语句中就在所有混沌的东西下面。
void SurfaceStack::draw(){
for(int i = 0; i < _surfaces.size(); ++i){
if(_surfaces[i]->getSource()->getType() == SourceType::SOURCE_TYPE_FBO){
glEnable(GL_BLEND);
glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
ofEnableAlphaBlending(); //<-- here
}else{
ofEnableAlphaBlending();
}
_surfaces[i]->draw();
}
}