new FX2D ignores frameRate()

edited December 2016 in Using Processing

Howdy, some days ago I had a little problem with my program having too little fps, so I tried some different renderers, including the brand new FX2D. While this one gave me awesome performance, with supposed framerates in the order of the tens of thousands, I wanted to lock it to 60. But frameRate(60) or similar makes my sketches go crazy reporting framerates such as 14000 and such. Using any other renderer fixes the problem but when using FX2D the framerate sparks to "OVER NINE THOUSAND!", which interferes with my animations. Also is seems more like 3fps than thousands but it could be too fast for us humans to see.

Is it just me or is this a processng bug?

EDIT After some testing, i belive that the fps are actually becoming pretty low, while the variable frameRate returns inaccuate values. I'm not sure tho, since even now the framerate sometimes jumps over 800

Answers

  • What testing did you do?
    Instead of allowing Processing to calculate frameRate, why not just use the frameCount variable to check yourself?

  • Don't use frameRate() or frameCount to control animation. The first assumes that the frame rate is being measured correctly, the second simply counts the frames rendered and does not take into account time.

    The solution is to use the time elapsed between frames. You can find out more here

  • Well, I'm not sure that this was a question on how to solve problematic frame rates. It was more of why it occurs.
    In any case, your advice is extremely important when designing a game (or anything else).

  • Yes, quark's suggestion is quite useful indeed.

    But I was more interested in knowing why this happens, because this looks like a bug to me.

    BTW the unreasonably high framerate is actually very slow, like 0.5 fps , calling a println echoing the millis confirms that.

    I guess this new feature is still prone to errors.

Sign In or Register to comment.