justingardner / mgl

A suite of mex/m files for displaying psychophysics stimuli
http://justingardner.net/mgl
Other
18 stars 22 forks source link

problems with mglMetalArcs #96

Open jhryuj opened 7 months ago

jhryuj commented 7 months ago

There seems to be few problems with mglMetalArcs. Two problems I've noticed so far:

  1. I noticed that it doesn't work in screen coordinates.
  2. alpha compositing seems odd. When I display an annulus on a black screen, I see a proper solid annulus. But when I display the annulus on a brighter background the annulus becomes faded out.

Screen coordinates example

% dots work in screen coordinates
mglOpen;
mglScreenCoordinates;
mglClearScreen([0 0 0]);
mglPoints2(mglGetParam('screenWidth')*rand(5000,1),mglGetParam('screenHeight')*rand(5000,1));
mglFlush;

% disks don't work in screen coordinates
mglOpen;
mglScreenCoordinates;
mglClearScreen([0 0 0]); 
mglGluDisk(mglGetParam('screenWidth')*rand(5000,1),mglGetParam('screenHeight')*rand(5000,1), 2, [1,0,0]);
mglFlush;

% disks do work in visual angle coordinates
mglOpen
mglVisualAngleCoordinates(57,[16 12]);
x = 16*rand(100,1)-8;
y = 12*rand(100,1)-6;
mglGluDisk(x, y, 0.1,  [0.1 0.6 1], 24, 2);
mglFlush;