[visionegg] Re: frames since go

  • From: Andrew Straw <astraw@xxxxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx, jsprayberry@xxxxxxxxxxxxxx
  • Date: Fri, 06 Nov 2009 08:41:41 -0800

Jordanna Sprayberry wrote:
Hello All,

I am having a problem where my number of calculated frames is different than my display frame rate. I am trying to update object position using a precalculated position vector and the timing variable "frames since go". On one computer with a refresh rate of 100 Hz (yes I entered this in the VE start up prompt), I was getting getting approximately 50 f.p.s. I reinstalled Vision Egg on a newer machine, and now I am getting 200 f.p.s. Any ideas? Is there code I can write to force the calculated frames to match up with the display rate?
The VE startup prompt "What will your monitor's refresh rate be (Hz)" does not set the framerate -- it only asks what it will be. To set it, turn VSYNC on and use your monitor drivers. (On Windows XP, right click on the Desktop and select Properties, go to the Settings tab, and click the Advanced button. In the new window, go to the Adapter tab, and click the "List All Modes..." button. ) Now, a very simple demo, e.g. target.py, should print out a histogram at the end showing that you achieved the desired frame rate. If you're faster than the desired frame rate, it means that vsync didn't work. Somehow you'll have to turn that on.

Once that's working, you have to make sure your stimulus draw loop is fast enough to not skip frames. One thing to note is that even drawing slightly too slow can cause a major drop in frame rate when vsync is on -- this is because you can only draw new frames after the old one has been displayed. So a frame that takes 1.0001 times the inter-frame interval to draw will take 2 times the IFI to be displayed.

I hope these tips help...

-Andrew


--
Andrew D. Straw, Ph.D.
California Institute of Technology
http://www.its.caltech.edu/~astraw/

======================================
The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: