ofxPiMapper
ofxPiMapper copied to clipboard
Outlines on png alpha image?
Hi!
So I am using a custom FBO source to render a background image and a PNG on top.
Without ofxPiMapper everything looks fine, but now I have these weird outlines around my png.
I tried using ofEnableAlphaBlending()
in both custom source and ofApp.cpp without success.
I also tried getting multisample antialiasing to work by using fbo->allocate(width, height, GL_RGBA, 4)
in FboSource.cpp but then I only get a black screen.
Any hints?
Hi! How big is the image and can you send me the file?
It's 70KB small. It's a cutout of the background so it should blend perfectly in.
I see. Can I have also the background?
I just linked it in my previous answer 👍
got it. will take a look.
Which platform are you using? As on Mac it fits perfectly.
My destination platform is Windows 10 using Visual Studio 2015. I just tried it on my Mac as well, but I get those outlines there as well 😕 My custom source just looks like this, with '2.png' being the background:
#include "CustomSource.h"
void CustomSource::setup(){
name = "Custom FBO Source";
allocate(1920, 1080);
img1.load("1.png");
img2.load("2.png");
}
// Don't do any drawing here
void CustomSource::update(){
}
void CustomSource::draw(){
img2.draw(0,0,1920,1080);
img1.draw(0,0,1920,1080);
}
Ah you using custom source. Good. Now I have more hints.
This was due the ofFbo using different ways of blending. I fixed that by adding the following to the SurfaceStack in ofxPiMapper code.
glEnable(GL_BLEND);
glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
Check commit for more details.
So this did work on my Mac. Unfortunately on Windows the problem still exists.
OK. Let's see...
So does OF on Windows use another method for blending the fbo? I tried updating to the latest version of glew.
I'm working on my windows virtualbox. unfortunatelly the internet where I am now is very slow and I am packed with deadlines. Soon...