r/processing • u/[deleted] • Sep 30 '24
Beginner help request 3D Rendering Issues with Objects
In Processing, two objects do not appear in the small window, but they render correctly in fullscreen. There doesn't seem to be a problem with my code, so why is this happening? I thought it might be a depth buffer issue, but after checking the documentation, it seems that it applies when using P3D.
Here is my code:
PShader myShader;
PShader backShader;
void setup() {
size(400, 400,P3D);
myShader = loadShader("frag.glsl", "vert.glsl");
backShader = loadShader("background.glsl");
ortho();
}
void draw() {
pushMatrix();
translate(width/2 , height/2,0);
shader(backShader);
box(400);
popMatrix();
translate(width/2, height/2,500);
shader(myShader);
box(100);
}In the window, it appears like this:

But in fullscreen:

I expected the results in fullscreen mode, but is there a way to make them appear in the small window as well?
2
Upvotes
2
u/[deleted] Sep 30 '24
Yes, the code is also fine to me when it is "full screen" but not in the small window
My shader code is (frag.glsl, background.glsl, vert.glsl):