Hello,
I would like to change contrast between the colours black and white on every frame. Theoretically, the resulting presentation should be a solid gray, as the colour is switching between black and white every frame. However, the result is a more kind of blue tone.
I wanted to try it for the DrawDots, however I realised the problem also occurs when drawing to the whole screen (see code). Did anyone find a solution for that or has a suggestion how to improve timing? Or is it simply not possible with Psychtoolbox. I already found a similar question in the forum here, however that was 10 years ago. Maybe there have been changes :)?
Problem occurs on MATLAB R2020b, Windows 10, 240 HZ Screen (However, I also changed to Mac OS Sierra, CAD Monitor, HDMI conncetor etc.)…
vbl = Screen('Flip', wPtr);
% ptp settings
Screen('Preference', 'SkipSyncTests', 0);
AssertOpenGL;
KbName('UnifyKeyNames');
screens = Screen('Screens');
screenNum = max(screens);
[wPtr, rect] = Screen('OpenWindow', screenNum);
ifi = Screen('GetFlipInterval', wPtr);
topPriorityLevel = MaxPriority(wPtr);
frameRate = Screen('FrameRate', screenNum);
HideCursor;
white = WhiteIndex(screenNum);
black = BlackIndex(screenNum);
grey = round((white+black)/2);
inc = white-grey; % contrast range for given white and grey values
Screen('FillRect', wPtr, grey)
Screen('TextSize', wPtr , 15);
Screen('Flip', wPtr);
[X,Y] = RectCenter(rect);
% Get the size of the on screen window in pixels
[screenXpixels, screenYpixels] = Screen('WindowSize', wPtr );
%% Paramters for Screen
movieDurationSecs = 1.5; %1.5
movieDurationFrames = round(movieDurationSecs * frameRate);
%% TRIAL-LOOP
for count = 1:nTrials
FlushEvents;
tex = [];
% Start with a grey screen
Screen('FillRect', wPtr, [0,255,0], FixCross(:,:,1)');
vbl = Screen('Flip', wPtr);
WaitSecs(1);
vbl = Screen('Flip', wPtr);
for i = 1:movieDurationFrames/2
Screen('FillRect', wPtr,[255 255 0]);
vblBlack(i) = Screen('Flip', wPtr, vbl + (waitframes - 0.5) * ifi);
Screen('FillRect', wPtr, [0 0 255]);
vblWhite(i) = Screen('Flip', wPtr, vbl + (waitframes - 0.5) * ifi);
end
WaitSecs(1);
end