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(); }
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; }