saveFrame() not saving the whole frame in P3D

Hello, I have a 1920x1080p P3D sketch that I want to export, however, when I use saveFrame(), it only saves what is appearing on the screen, so I get a frame that has a part of it cut off and black. I have a 1366x768p display.

This is what I’m trying to achieve (note that this frame is 960x540p because I still can’t make it work for 1080p):
frame

This is what I get (this one is 1080p):

I also tried using something like:

PImage img;
img = get();
img.save(nf(frameCount, 6) + ".png");

but it still doesn’t work, it just changes the cut-off part to transparent instead of black.

Also, I tried using pixelDensity(2) hoping that it would make the sketch fit on the screen, but I got a message saying that I can’t use pixelDensity(2) on my display.

Thanks in advance :smile:

1 Like

Are there any errors? There is a possibility it was not given enough memory. That can be changed in the processing settings. You could also try to just use save(loc); as I have seen this saves the frame. Im not sure but could the black be transparency? I think I would need to see the code to try know whats going on. Try saving the screen with a smaller set size. You are probably using fullscreen(); use size(500,500); or something, and see if it captures all the pixels on that size.

I have added a PGraphics object named pg, added all the elements to it instead of the main sketch, and used pg.save() on it, it works properly now.

3 Likes