Setting border color with theTexture->setWrapS(GL_CLAMP_TO_BORDER);


#1

Hi,

I would like to set GL wrap to transparent (ColorA(0.0f,0.0f,0.0f,0.0f)) as per this page, but somehow I always get black. The only way I can get transparent is if pass theTexture through a vFBO and a shader.

So, with examples

If I do this:
gl::Texture2d::Format fmt;
fmt.setBorderColor(ColorA(0.0f, 0.0f, 0.0f, 0.0f));
fmt.loadTopDown(true);
theTexture = gl::Texture2d::create(loadImage(pathToTheFile), fmt);
theTexture->setWrapS(GL_CLAMP_TO_BORDER);
theTexture->setWrapT(GL_CLAMP_TO_BORDER);

I get black edges instead of transparent.

But if I instead create a scoped shader (I am omitting unnecessary lines for the purpose of clarity):
gl::ScopedGlslProg shader(mShader);
gl::drawSolidRect(vFbo->getBounds());
theTexture = vFbo->getColorTexture();
theTexture->setWrapS(GL_CLAMP_TO_BORDER);
theTexture->setWrapT(GL_CLAMP_TO_BORDER);

Then I do get transparent edges.

My question is is there a way to achieve transparent edges without using a shader?

I hope I explained it sufficiently.

Thanks for all the suggestions!
Mitja