Passing large amounts of data to the graphics cardĬalls that move, resize, rotate your stimuli are likely to carry almost no overheadĬalls that alter the color, contrast or opacity of your stimulus will also have no overhead IF your graphics card supports OpenGL Shaders when rendering a dynamic or brief stimulus). There are three things that are relatively slow and should be avoided at critical points in time (e.g. The graphics card has to blend a sinusoidal grating with a grey background, using a Gaussian profile, several hundred times each at a different orientation and location and it does this in less than one screen refresh on a good graphics card. Consider, for instance, the PsychoPy ® Coder demo elementArrayStim in which several hundred Gabor patches are updated frame by frame. The fact that modern graphics processors are extremely powerful they can carry out a great deal of processing from a very small number of commands. For further information see the sections on Detecting dropped frames and Reducing dropped frames. As a result, time-consuming operations such as disk accesses or execution of many lines of code, should be avoided while stimuli are being dynamically updated (if you care about the precise timing of your stimuli). In this case the previous frame will be left on screen for a further frame period and the flip will only take effect on the following screen update. If the code/processing required to render all you stimuli to the screen takes longer to complete than one screen refresh then you will ‘drop/skip a frame’. For further information about synchronising and waiting for the refresh see Sync to VBL and wait for VBL. These timestamps are very precise on most computers. In addition to synchronising flips to the frame refresh rate, PsychoPy ® can optionally go a further step of not allowing the code to continue until a screen flip has occurred on the screen, which is useful in ascertaining exactly when the frame refresh occurred (and, thus, when your stimulus actually appeared to the subject). The monitor updates at a very precise fixed rate and the flipping of the window will be synchronised to this monitor update if possible (see Sync to VBL and wait for VBL).Įach update of the window is referred to as a ‘frame’ and this ultimately determines the temporal resolution with which stimuli can be presented (you cannot present your stimulus for any duration other than a multiple of the frame duration). At some point in time, when we have rendered to this buffer all the objects that we wish to be presented, the buffers are ‘flipped’ such that the stimuli we have been drawing are presented simultaneously. The way in which stimuli are combined according to transparency rules is determined by the blend mode of the window. The back buffer initially starts blank (all pixels are set to the window’s defined color) and as stimuli are ‘rendered’ they are gradually added to this back buffer. In the double-buffered system, stimuli are initially drawn into a piece of memory on the graphics card called the ‘back buffer’, while the screen presents the ‘front buffer’. For example, when an image is rotated the calculations to determine what pixel values should result, and any interpolation that is needed, are determined by the graphics card automatically. This means that, as much as possible, the necessary processing to calculate pixel values is performed by the graphics card GPU rather than by the CPU. All rendering performed by PsychoPy ® uses hardware-accelerated OpenGL rendering where possible.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |