Hi, this is on a MBP (NVidia 9600M) running 10.6.4 (+graphics update) and Matlab 2010a. If I use ColorRange to let me use 0-1 as a color range, MakeTexture fails to use this range, so if I make a simple texture:
[window winrect]=Screen('OpenWindow', 0, 128);
Screen('ColorRange', window, 1.0)
white=WhiteIndex(window); %this returns 1 as expected
black=BlackIndex(window); %this returns 0 as expected
gray=GrayIndex(window); %this returns 0.5 as expected
tex=ones(100,5,3)*white; %a 100x5px bar filled white
ti=Screen('MakeTexture',window,tex);
for i=1:240
Screen('DrawTexture', window, ti,[],[],45)
Screen('Flip',window);
end
I see a black bar. If I fill the texture with 255 it becomes white, so it appears to be ignoring the ColorRange command. Indeed If I add in a precedural grating into the same code:
tb=CreateProceduralSineGrating(window, 128,128,[gray gray gray 1]);
...
Screen('DrawTexture', window, tb, [],[], 45, [], [], [], [],[], [0,0.02,0.25,1]);
...
Then this works as expected (mid-level grating). Not sure if I'm missing something (sunday morning coding not always a good idea!), or this is genuinely a bug. I've tried setting up the window using PsychImaging and 'NormalizedHighresColorRange' etc. and see the same thing.
Ian
[window winrect]=Screen('OpenWindow', 0, 128);
Screen('ColorRange', window, 1.0)
white=WhiteIndex(window); %this returns 1 as expected
black=BlackIndex(window); %this returns 0 as expected
gray=GrayIndex(window); %this returns 0.5 as expected
tex=ones(100,5,3)*white; %a 100x5px bar filled white
ti=Screen('MakeTexture',window,tex);
for i=1:240
Screen('DrawTexture', window, ti,[],[],45)
Screen('Flip',window);
end
I see a black bar. If I fill the texture with 255 it becomes white, so it appears to be ignoring the ColorRange command. Indeed If I add in a precedural grating into the same code:
tb=CreateProceduralSineGrating(window, 128,128,[gray gray gray 1]);
...
Screen('DrawTexture', window, tb, [],[], 45, [], [], [], [],[], [0,0.02,0.25,1]);
...
Then this works as expected (mid-level grating). Not sure if I'm missing something (sunday morning coding not always a good idea!), or this is genuinely a bug. I've tried setting up the window using PsychImaging and 'NormalizedHighresColorRange' etc. and see the same thing.
Ian