PROPixx Demo 3 -- Drawing dots at 1440 Hz with blending ============================================================== This demo is a simple demonstration of the PROPixx's 1440 Hz sequencer. We display a single white dot in the center of the screen, refreshing at 1440 Hz. The demo ends when a key is pressed. The PROPixx uses a "sequencer" to break up a single 1920 x 1080, 120 Hz RGB video signal into 12 multiple frames displayed in sequence. The 1920 x 1080 image is first divided into four 960 x 540 images, or "quadrants", which are magnified to full screen. Each 8-bit RGB color channel is then converted to grayscale and displayed separately. The order of appearance is Q1 red, Q2 red, Q3 red, Q4 red, and then this order is repeated for G and B channels. .. image:: Quad12xStill.* :width: 500 :align: center To create our stimuli, we determine target locations as if they were full resolution, full screen. The helper script ``convertToQuadrant`` reassigns and rescales the target positon to the correct quadrant. Depending on the frame, we draw our targets as either full red, full green or full blue. Because our targets overlap in position, we use blending to ensure that red, green and blue colors are correctly added to the image. Without blending, the image will only contain the last color drawn in that position (blue) and our dot will only appear on 4/12 frames. This is often visually apparent in 1440 Hz as a drop in luminance. To blend different color textures, we use Psychtoolbox's Screen ``'BlendFunction'`` and specify which channel [R, G, B, alpha] we want to draw to. Channels set to 0 will be preserved/blended instead of overwritten. A screen running in 120 Hz mode will display our four blended dots on the same frame and in the correct quadrants. .. image:: 1440HzDemo2FullHD.* :width: 300 :align: center The PROPixx in 1440 Hz mode will display red, green and blue, quadrant by quadrant. The image will be full screen, grayscale: .. image:: 1440HzDemo2.* :width: 300 :align: center Drawing twelve full R, G, B dots and blending them is functionally equivalent to drawing four white dots. That is, if you have overlapping stimuli with the same characteristics, you can opt to draw them as a single stimulus and populate more than one color channel when defining the texture. The sequencer will behave the same way in either case, drawing the different color channels in different frames. In this demo, we draw the colored dots individually in order to demonstrate blending. .. literalinclude:: ../DatapixxToolbox/DatapixxDemos/PPxDraw1440HzDots2.m :language: matlab :emphasize-lines: 55-56, 73, 77, 83, 87, 93, 97, 117-118, 123-137 :linenos: