void PortGroup::reattachTargets() { if (!fbo_) return; fbo_->activate(); fbo_->detachAll(); if (ports_.empty()) return; bool hasDepth_ = false; for (size_t i=0; i<ports_.size(); ++i) { RenderPort* p = ports_[i]; if (!ignoreConnectivity_ && !p->isConnected()) continue; if (p->getColorTexture()) fbo_->attachTexture(p->getColorTexture(), GL_COLOR_ATTACHMENT0_EXT+i); if (!hasDepth_ && p->getDepthTexture()) { hasDepth_ = true; fbo_->attachTexture(p->getDepthTexture(), GL_DEPTH_ATTACHMENT_EXT); } } LGL_ERROR; if (hasDepth_) fbo_->isComplete(); }
void TripleView::renderPortQuad(RenderPort& rp, tgt::vec3 translate, tgt::vec3 scale) { rp.bindColorTexture(GL_TEXTURE0); rp.getColorTexture()->enable(); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); MatStack.translate(translate.x, translate.y, translate.z); MatStack.scale(scale.x, scale.y, scale.z); glDepthFunc(GL_ALWAYS); renderQuad(); glDepthFunc(GL_LESS); MatStack.loadIdentity(); rp.getColorTexture()->disable(); }