I’m trying to understand the speed issue. I am running Windows 7 64-bit.
I wrote a simple test program (below) that basically blinks the window black and white.
At reasonably high frame rates ( 5 and higher), the color fill is not uniform.
I don’t know how to determine whether this is a limitation of my hardware, or the Processing graphics engine.
Before embarking on what I’m sure would be a arduous time-consuming detour into C++, I am hoping someone can tell me whether I can expect that C++ would perform this task faster with consistent uniformity.
int iColor;
void setup()
{ size(1200, 2200);
noStroke(); // Don't draw a stroke around shapes
frameRate(10);
iColor = 0 ;
}
void draw() // this whole block repeats at the frameRate
{ color c = color( iColor,iColor,iColor ); // Define color 'c'
fill(c); // Use color variable 'c' as fill color
rect(0,0,1200,2200);
if( iColor == 0 ){ iColor = 255 ; } else { iColor = 0 ; }
}
C++ will not make a difference because the issue has nothing to do with the speed the sketch executes. If you think about it you have slower down the sketch by lowering the frame rate anyway.
I am no expert on graphics cards and screen refresh rates but I suspect the problem has little to do with software and hardware and more to do with human perception.
BTW I suggest that you remove your email address from your posts to reduce the risk of spam.
But your program ran perfectly smoothly for me in Processing on a late model Microsoft Surface Book 3 (windows 11). Even when I made it almost full-screen:
Happy for you But I believe one shouldn’t require a late mode Microsoft Surface Book 3 to draw one moving line smoothly Also, if you have such a high resolution maybe the jittering is not visible because it’s too tiny to notice.
On the older desktop running Windows 7 64-bit the image was fractured in a rectilinear pattern which I don’t think is typical of limitations of human perception. That pattern did not appear when I tried the program on a late model Microsoft Surface Book 3 (windows 11), but I did see effects likely due to human perception. At frameRate=40, there seemed to be pauses, as if the computer could not keep up with the requested frame rate. FYI the display (internal laptop) spec says “refresh rate” = 59.99 Hz.
Anyway, thanks for the suggestion, I will be looking into openFrameworks soon. But meantime, I came across Cinder, which seems more closely tied to the specific hardware of the PC and so (if I am understanding correctly) could be expected to be faster ? What do you think ? Or anyone else ?
I wouldn’t say one framework is faster than the other. The thing that really makes the difference is the ability of the programmer. Even when comparing Java and C++. Looking at the forum openFrameworks seems to have a larger and more active community. And it is nice that you can run programs in Desktop, mobile and Raspberry Pi, even if your current program doesn’t need it. A book in case you want to experiment with it. I must say that errors can be more painful to debug in C++. As in the program closing without any message and having no idea why. But it is probably useful to try different languages to have your own impression