Example #1
0
void CompositeProcessorGL::compositePortsToOutport(ImageOutport& outport, ImageType type, ImageInport& inport) {
    if (inport.isReady() && outport.hasData()) {        
        utilgl::activateTarget(outport, type);
        shader_.activate();

        TextureUnitContainer units;
        utilgl::bindAndSetUniforms(shader_, units, *inport.getData(),  "tex0", ImageType::ColorDepthPicking);
        utilgl::bindAndSetUniforms(shader_, units, *outport.getData(), "tex1", ImageType::ColorDepthPicking);
        utilgl::setShaderUniforms(shader_, outport, "outportParameters");
        utilgl::singleDrawImagePlaneRect();

        shader_.deactivate();
        utilgl::deactivateCurrentTarget();
    }
}
Example #2
0
void bindAndSetUniforms(Shader& shader, TextureUnitContainer& cont, ImageOutport& port,
                        ImageType type) {
    bindAndSetUniforms(shader, cont, *port.getData(), port.getIdentifier(), type);
}
Example #3
0
void setShaderUniforms(Shader& shader, const ImageOutport& outport, const std::string samplerID) {
    setShaderUniforms(shader, *outport.getData(),
                      samplerID.empty() ? outport.getIdentifier() + "Parameters" : samplerID);
}
Example #4
0
void unbindTextures(const ImageOutport& outport) {
    unbindTextures(*outport.getData(), true, true, true);
}
Example #5
0
void unbindPickingTexture(const ImageOutport& outport) {
    unbindTextures(*outport.getData(), false, false, true);
}
Example #6
0
void unbindDepthTexture(const ImageOutport& outport) {
    unbindTextures(*outport.getData(), false, true, false);
}
Example #7
0
void bindTextures(const ImageOutport& outport, const TextureUnit& colorTexUnit,
                  const TextureUnit& depthTexUnit, const TextureUnit& pickingTexUnit) {
    bindTextures(*outport.getData(), true, true, true, colorTexUnit.getEnum(),
                 depthTexUnit.getEnum(), pickingTexUnit.getEnum());
}
Example #8
0
void bindPickingTexture(const ImageOutport& outport, const TextureUnit& texUnit) {
    bindTextures(*outport.getData(), false, false, true, 0, 0, texUnit.getEnum());
}
Example #9
0
void bindColorTexture(const ImageOutport& outport, const TextureUnit& texUnit) {
    bindTextures(*outport.getData(), true, false, false, texUnit.getEnum(), 0, 0);
}
Example #10
0
void bindTextures(const ImageOutport& outport, GLenum colorTexUnit, GLenum depthTexUnit,
                  GLenum pickingTexUnit) {
    bindTextures(*outport.getData(), true, true, true, colorTexUnit, depthTexUnit,
                 pickingTexUnit);
}
Example #11
0
void bindPickingTexture(const ImageOutport& outport, GLenum texUnit) {
    bindTextures(*outport.getData(), false, false, true, 0, 0, texUnit);
}
Example #12
0
void bindDepthTexture(const ImageOutport& outport, GLenum texUnit) {
    bindTextures(*outport.getData(), false, true, false, 0, texUnit, 0);
}