I'm new to the exciting world of calling opengl from matlab. My filled polygons have
pixelated edges. Enabling 'polygon smooth' doesn't seem to make the difference that it
should. Please help! Thanks.
Here's the relevant bit of my code and the PTB output (pasted below):
Screen('BeginOpenGL', window);
glEnable(GL.BLEND);
glBlendFunc(GL.ONE, GL.SRC_ALPHA);
%glBlendFunc(GL.SRC_ALPHA_SATURATE, GL.ONE);
glClearColor(0, 0, 0, 0);
glClear(GL.COLOR_BUFFER_BIT);
glEnable(GL.POLYGON_SMOOTH);
glHint(GL.POLYGON_SMOOTH_HINT, GL.NICEST);
glDisable(GL.DEPTH_TEST);
for(i=1:length(screenLX))
glColor4f(1, 0, 0, 1);
%glBegin(GL.QUADS);
glBegin(GL.POLYGON);
glVertex2f(screenLX(i, 1), screenLY(i, 1));
glVertex2f(screenLX(i, 2), screenLY(i, 2));
glVertex2f(screenLX(i, 3), screenLY(i, 3));
glVertex2f(screenLX(i, 4), screenLY(i, 4));
glEnd;
glColor4f(0, tex_luminanceR(i), 0, 1);
glBegin(GL.QUADS);
glVertex2f(screenRX(i, 1), screenRY(i, 1));
glVertex2f(screenRX(i, 2), screenRY(i, 2));
glVertex2f(screenRX(i, 3), screenRY(i, 3));
glVertex2f(screenRX(i, 4), screenRY(i, 4));
glEnd;
end;
Screen('EndOpenGL', window);
PTB-INFO: This is the OpenGL-Psychtoolbox version 3.0.8. Type 'PsychtoolboxVersion' for
more detailed version information.
PTB-INFO: Psychtoolbox is licensed to you under terms of the GNU General Public License
(GPL). See file 'License.txt' in the
PTB-INFO: Psychtoolbox root folder for a copy of the GPL license.
PTB-INFO: OpenGL-Renderer is ATI Technologies Inc. :: ATI Radeon 9600 XT OpenGL
Engine :: 1.5 ATI-1.4.18
PTB-INFO: Renderer has 128 MB of VRAM and a maximum 122 MB of texture memory.
PTB-Info: VBL startline = 960 , VBL Endline = 975
PTB-Info: Measured monitor refresh interval from beamposition = 16.717702 ms
[59.816833 Hz].
PTB-Info: Will use beamposition query for accurate Flip time stamping.
PTB-Info: Measured monitor refresh interval from VBLsync = 16.773761 ms [59.616921
Hz]. (298 valid samples taken, stddev=0.969760 ms.)
PTB-Info: Small deviations between reported values are normal and no reason to worry.
PTB-INFO: Support for OpenGL 3D graphics rendering enabled: 24 bit depth-buffer and 8
bit stencil buffer attached.
PTB-INFO: Using OpenGL GL_TEXTURE_RECTANGLE_EXT extension for efficient high-
performance texture mapping...
I'm using a PowerBook G4.
pixelated edges. Enabling 'polygon smooth' doesn't seem to make the difference that it
should. Please help! Thanks.
Here's the relevant bit of my code and the PTB output (pasted below):
Screen('BeginOpenGL', window);
glEnable(GL.BLEND);
glBlendFunc(GL.ONE, GL.SRC_ALPHA);
%glBlendFunc(GL.SRC_ALPHA_SATURATE, GL.ONE);
glClearColor(0, 0, 0, 0);
glClear(GL.COLOR_BUFFER_BIT);
glEnable(GL.POLYGON_SMOOTH);
glHint(GL.POLYGON_SMOOTH_HINT, GL.NICEST);
glDisable(GL.DEPTH_TEST);
for(i=1:length(screenLX))
glColor4f(1, 0, 0, 1);
%glBegin(GL.QUADS);
glBegin(GL.POLYGON);
glVertex2f(screenLX(i, 1), screenLY(i, 1));
glVertex2f(screenLX(i, 2), screenLY(i, 2));
glVertex2f(screenLX(i, 3), screenLY(i, 3));
glVertex2f(screenLX(i, 4), screenLY(i, 4));
glEnd;
glColor4f(0, tex_luminanceR(i), 0, 1);
glBegin(GL.QUADS);
glVertex2f(screenRX(i, 1), screenRY(i, 1));
glVertex2f(screenRX(i, 2), screenRY(i, 2));
glVertex2f(screenRX(i, 3), screenRY(i, 3));
glVertex2f(screenRX(i, 4), screenRY(i, 4));
glEnd;
end;
Screen('EndOpenGL', window);
PTB-INFO: This is the OpenGL-Psychtoolbox version 3.0.8. Type 'PsychtoolboxVersion' for
more detailed version information.
PTB-INFO: Psychtoolbox is licensed to you under terms of the GNU General Public License
(GPL). See file 'License.txt' in the
PTB-INFO: Psychtoolbox root folder for a copy of the GPL license.
PTB-INFO: OpenGL-Renderer is ATI Technologies Inc. :: ATI Radeon 9600 XT OpenGL
Engine :: 1.5 ATI-1.4.18
PTB-INFO: Renderer has 128 MB of VRAM and a maximum 122 MB of texture memory.
PTB-Info: VBL startline = 960 , VBL Endline = 975
PTB-Info: Measured monitor refresh interval from beamposition = 16.717702 ms
[59.816833 Hz].
PTB-Info: Will use beamposition query for accurate Flip time stamping.
PTB-Info: Measured monitor refresh interval from VBLsync = 16.773761 ms [59.616921
Hz]. (298 valid samples taken, stddev=0.969760 ms.)
PTB-Info: Small deviations between reported values are normal and no reason to worry.
PTB-INFO: Support for OpenGL 3D graphics rendering enabled: 24 bit depth-buffer and 8
bit stencil buffer attached.
PTB-INFO: Using OpenGL GL_TEXTURE_RECTANGLE_EXT extension for efficient high-
performance texture mapping...
I'm using a PowerBook G4.