예제 #1
0
파일: background.cpp 프로젝트: sunwj/inviwo
void Background::process() {
    if (inport_.hasData() != hadData_) initializeResources();
    if (inport_.hasData()) {
        utilgl::activateTargetAndCopySource(outport_, inport_, ImageType::ColorOnly);
    } else {
        utilgl::activateTarget(outport_, ImageType::ColorOnly);
    }
    shader_.activate();
    TextureUnitContainer units;
    if (inport_.hasData()) utilgl::bindAndSetUniforms(shader_, units, inport_, ImageType::ColorOnly);
   
    utilgl::setUniforms(shader_, outport_, color1_, color2_, checkerBoardSize_);
    utilgl::singleDrawImagePlaneRect();
    shader_.deactivate();
    utilgl::deactivateCurrentTarget();
}
예제 #2
0
파일: tmip.cpp 프로젝트: Ojaswi/inviwo
TMIP::TMIP()
    : Processor()
    , inport_("inport")
    , outport_("outport")
    , shader_("volume_gpu.vert", "volume_gpu.geom", "tmip.frag", false)
    , shaderLast_("volume_gpu.vert", "volume_gpu.geom", "tmip.frag", false)
    , fbo_() {
    addPort(inport_);
    addPort(outport_);

    inport_.onChange([this]() { initializeResources(); });

    glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &maxSamplers_);
    maxSamplers_ -= 1;
    // maxVolumesGL_ = 2;
}