We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have a bunch of code that is suppose to produce a semi transparent circle over another circle, and it works with the regular renderer, but not with P2D. I understand that for this example, P2D is not needed, but it is for a larger project, and I have isolated the problem to the renderer. Any idea why P2D doesn't produce transparent shapes in this case?
void setup() {
background(0);
size(700, 700, P2D);
strokeWeight(2.5);
stroke(255);
}
void draw() {
background(0);
//for the red, non transparent circle:
fill(255,0,0);
ellipse(100,75,50,50);
//for the purplish transparent circle:
fill(255, 0, 255, 150);
ellipse(100,100,50,50);
}
Answers
I was lucky at placing
updatePixels();
just beforebackground(0);
! @-)Using
noLoop();
also worked in place of the former! %%-If you are on Processing 2, P2D is OpenGL, and extra care must be taken to handle transparency, from what I have understood.
Works like a charm! Thanks