Factors Affecting Animation Performance
Animation performance depends on a large number of factors that include the amount of graphic content in each frame and the capabilities of the hardware. You adjust the animation rate by setting the timer interval value of the IDLitWindow object. When the timer interval expires, IDL calls the OnTimer method of the behavior objects that are observing the window. If the hardware can draw the entire scene graph within the requested timer interval, IDL waits until the timer interval expires before calling the OnTimer methods again, in order to produce the requested animation rate. If IDL was performing another operation or computation when the timer interval began, it returns to that task after drawing the scene and until the time interval expires again. If IDL cannot draw the entire scene graph before the timer interval expires, it finishes drawing the scene graph and immediately moves on to the next frame by calling the OnTimer method again, as long as the window timer is running. Any excess timer expirations are discarded so they do not "pile up" behind the animation. Therefore, you may experience a "maximum possible frame rate" that depends on the graphic content and the capabilities of the machine you are using.
Scene graphs that contain a large amount of graphical information and/or render slowly can reduce the maximum achievable frame rate. Very large polygonal meshes and volumes are examples of graphical content that will reduce animation performance.
Multiple Image Copies
If you are animating a very large amount of image data, the maximum frame rate may also be reduced if the total amount of image data exceeds the space available on the video card and system memory. IDL attempts to optimize image rendering by keeping image data in the video card memory and in system memory as video card memory is exhausted. If the image memory requirements exceed the amount of space available in "fast" memory, (video and system memory), the system may move image data out to "slow" memory (paging space). This can reduce image animation performance as older images need to be swapped back into video memory when they need to be displayed again. If this occurs, consider using a single IDLgrImage object in your animation and replace the image data in the image object with image data for the next frame in the OnTimer method. This reduces the total number of copies of image data stored in memory at once and still provides good performance. It is best to put all your image data into IDLgrImage objects when the images all fit into memory and there is a requirement to rapidly animate all the images in a loop. If all the images do not fit into memory or if rapid access to all the images is not necessary, it may be better to use a single IDLgrImage object.
Graphics Display Refresh Rate
Maximum frame rates may also be restricted by the refresh rate of your graphics display device if the screen refresh rate is tied to applications. This can prevent the application from exceeding the refresh rate of the display device, which is often in the range of 60-120 frames per second. If you find that you cannot create an animation faster than the refresh rate, look for a setting on your video card control software to disable this synchronization. It is often referred to as VSYNC, vertical synchronization, or "refresh rate override".
Using application frame rates in excess of display device frame rates with synchronization turned off is often not useful and can even be distracting because of missing or "dropped" frames. For example, if you try to display a 10-image animation on a display device using a 60 Hz refresh rate at 600 frames per second, the animation will appear stalled, since the user will see the same image over and over. The other 9 images are drawn to the display between display device refreshes and are "dropped".