在openFrameworks中,是否可以在使用ofxPiMapper时更改我的fbo源的不透明度?

问题描述 投票:0回答:1

在openFrameworks中,是否可以在使用ofxPiMapper时更改我的fbo源的不透明度?

c++ mapping opacity openframeworks fbo
1个回答
0
投票

弄清楚了:

进入addons / ofxPiMapper / src / Surfaces / SurfaceStack.cpp在SurfaceStack :: draw()中,将forEnableAlphaBlending()添加到所有glblend东西下的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();
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.