We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi everybody.
i have a p3d program, that gives me 40 fps when i define my background with "background(0,0,20)". when i use an image as background "background(pImage)" i get only 10 fps. is this drop in the framerate an expected behaviour? it seems way to much for me. the image is 1680px * 1050px (same dimension as the whole sketch). the image is loaded in the setup-function. i am running processing in version 2.2.1.
any help appreciated.
thanks martin
Answers
tested it in a basic sketch. i only get 14 fps. how can that be?
Try getting rid of lines 5 and 6 then see what happens?
Do you need a 3D renderer does P2D help?
Also might try replacing line 14 with
Just some ideas I have no idea if these will help.
In a situation like this is is always worthy experimenting with the code to try and get some hints as to the problem.
using
image
instead ofbackground
makes a big difference. now the test sketch gives me 300 fps. way better.but still strange. the test sketch runs at 400 fps when i do not use an image. 100 fps seems pretty costy for an image as background. maybe the reason is that the image is send over to the graphics card every frame. is there a way to avoid this? it's a static background. so it doesn't need to be send over every frame.
thanks quark.
Renderer JAVA2D is currently the only 1 which isn't OpenGL.
For JAVA2D, background() & set() would be much faster than image()! 8-}
ok, good to know. but i need my opengl/3d.
I tried the different options on my computer with Processing 2.2.1.
Test settings
Test results
So the only one that shows slowdown is background(bg). There are 5 other options that all give 400 or above fps. So whatever is causing this, I think the solution is fairly simple, use one of the other options.
cool. thanks for the effort. i will go on with the image-version.
still looks like a bug to me. so i made an issue out of it: https://github.com/processing/processing/issues/3012