Hi,
I’m having this problem when using this particular process of drawing an image multiple times to the screen. I’m getting either white or black fringing, depending on which renderer I use (Default / OpenGL). I imagine this is something to do with premultiplied alpha.
The code below replicates the problem.
What I find strange is that every time a new image is drawn, the previous images on the screen are still having their ‘fringe’ effect increased. Seems like some sort of OpenGL memory buffer thing.
PGraphics pg;
PImage img;
void setup(){
size(800,800,OPENGL);
background(0);
pg=createGraphics(800,800,OPENGL);
img=createImage(800,800,ARGB);
pg.beginDraw();
pg.noStroke();
pg.fill(200,0,0);
pg.ellipse(400,400,300,300);
pg.endDraw();
frameRate(1);
}
void draw(){
float x=map(random(1),0,1,-300,300);
float y=map(random(1),0,1,-300,300);
img.copy(pg,0,0,800,800,int(x),int(y),800,800);
image(img,0,0);
}