Classical error, you forgot that draw(), as well as beginDraw(), doesn't clear the graphics buffer (main or specified).
Somehow, the anti-aliasing of borders (graphics and rect, I suppose), when cumulated, erases the drawing.
Notice I didn't had an issue in my test code because I have a background() instruction at the start of the draw.
If I change the code to:
Code:nt OUTPUT_WINDOW_WIDTH = 8;
int OUTPUT_WINDOW_HEIGHT = 8;
int OUTPUT_WINDOW_POSITION_X = 20;
int OUTPUT_WINDOW_POSITION_Y= 20;
int OUTPUT_WINDOW_WIDTH2 = 20;
int OUTPUT_WINDOW_HEIGHT2 = 20;
int OUTPUT_WINDOW_POSITION_X2 = 50;
int OUTPUT_WINDOW_POSITION_Y2= 20;
PGraphics outputScreen;
PGraphics outputScreen2;
void setup() {
size(500, 500);
frameRate(5);
outputScreen = createGraphics(OUTPUT_WINDOW_WIDTH, OUTPUT_WINDOW_HEIGHT, P3D);
outputScreen2 = createGraphics(OUTPUT_WINDOW_WIDTH2, OUTPUT_WINDOW_HEIGHT2, P3D);
outputScreen.beginDraw();
outputScreen.background(#dce6ee);
outputScreen.rect(1,1,2,2);
outputScreen.endDraw();
outputScreen2.beginDraw();
outputScreen2.background(#dce6ee);
outputScreen2.rect(1,1,2,2);
outputScreen2.endDraw();
}
void draw(){
background(200);
image(outputScreen, OUTPUT_WINDOW_POSITION_X, OUTPUT_WINDOW_POSITION_Y);
image(outputScreen2, OUTPUT_WINDOW_POSITION_X2, OUTPUT_WINDOW_POSITION_Y2);
}
(Reminder: keep size() call first of setup() and use numerical values)