Docs @ Psychtoolbox Wiki : PsychOpenGL

Search PTB Function help:
homepsychtoolbox.orgpage updateslogin

Revision [14038]

Last edited on 2011-07-05 05:44:26 by DocBot
Additions:
(MOGL), whose original OS/X version was developed, implemented and
contributed to Psychtoolbox under the MIT license by Prof. Richard F.
Murray, University of York, Canada. (The code was under GPL license until
2010, but has been relicensed to the more permissive MIT license in 2011).
Please note that InitializeMatlabOpenGL() allows to optionally set the
'debuglevel', the amount of error checking automatically performed during
execution of your scripts. By default, the debug level is set so that
MOGL checks for OpenGL errors after execution of each single OpenGL call!
This is nice for debugging code, but can significantly impact performance
for complex rendering code! Make sure to explicitely set the debuglevel
to '0' once your experiment code is performing as expected, so you can
get higher rendering performance.
no code to setup the window, OpenGL rendering context, or to flip the
front- and backbuffers. Psychtoolbox takes care of setting up OpenGL and
windows for you. You just need to call the InitializeMatlabOpenGL;
function at the beginning of your script and wrap each invocation of your
mex-file into [[Screen]]('BeginOpenGL', win) and [[Screen]]('EndOpenGL',win)
calls. Use the [[Screen]]('[[Flip]]', win) command as usual to take care of
stimlulus onset.
If you use many immediate mode OpenGL rendering calls, rendering speed in
Matlab may be significantly lower than when executing the same code from
C or C""++"". This is the price you'll have to pay for using Matlab. However,
immediate mode rendering is discouraged even in C for anything but the
most trivial tasks, it's just that you pay a slightly higher "time
penalty" for doing the wrong thing in Matlab than in C. Well written code
will not cause any significant performance difference to C.
Deletions:
(MOGL) which was developed, implemented and contributed to Psychtoolbox
under the GPL license by Prof. Richard F. Murray, University of York, Canada.
no code to setup the window, OpenGL rendering context, or to flip the front- and
backbuffers. Psychtoolbox takes care of setting up OpenGL and windows for
you. You just need to call the InitializeMatlabOpenGL; function at the
beginning of your script and wrap each invocation of your mex-file into
[[Screen]]('BeginOpenGL', win) and [[Screen]]('EndOpenGL',win) calls. Use the
[[Screen]]('[[Flip]]', win) command as usual to take care of stimlulus onset.
Depending on your specific code, rendering speed in Matlab may be
significantly lower than when executing the same code from C or C""++"". This
is the price you'll have to pay for using Matlab.
The OpenGL for Matlab support is a pretty new feature so it may contain a
couple of bugs or glitches, especially when interacting with Psychtoolbox
drawing commands. If you mix PTB and OpenGL drawing commands a lot, you
may experience some side-effects. If you happen to find one, please report it!


Revision [12136]

Edited on 2010-12-06 10:29:59 by DocBot
Additions:
"http://svn.berlios.de/svnroot/repos/osxptb/beta/Psychtoolbox/Contents.m">beta</a> | view WebSVN <a href=
"http://svn.berlios.de/wsvn/osxptb/trunk/Psychtoolbox/Contents.m?op=log">changelog</a> of trunk branch</span>
Deletions:
"http://svn.berlios.de/svnroot/repos/osxptb/beta/Psychtoolbox/Contents.m">beta</a> | view in <a href=
"http://svn.berlios.de/wsvn/osxptb/beta/Psychtoolbox/Contents.m?view=markup">WebSVN with changelog</a></span>


Revision [10161]

Edited on 2010-09-09 15:35:41 by DocBot
Additions:
"http://svn.berlios.de/wsvn/osxptb/beta/Psychtoolbox/Contents.m?view=markup">WebSVN with changelog</a></span>
Deletions:
"http://svn.berlios.de/viewcvs/osxptb/beta/Psychtoolbox/Contents.m?view=markup">WebSVN with changelog</a></span>


Revision [9578]

Edited on 2009-04-28 06:26:51 by DocBot
Additions:
* moglDrawDots3D() -- High speed drawing of 3D dots or points, similar to
[[Screen]]('DrawDots') for the 2D case.


Revision [9250]

Edited on 2008-11-05 06:47:40 by DocBot
Additions:
* moglFDF() -- A high-speed renderer for "formless dot fields", random
dot field motion stimuli for the creation of "structure from motion"
stimuli from 3D objects.


Revision [8332]

Edited on 2008-09-25 18:40:39 by DocBot
Additions:
""
<div class="code_header" style="text-align:right;">
<span style="float:left;">Path  </span> <span class="counter">Retrieve current version of Contents.m from berliOS: <a href=
"http://svn.berlios.de/svnroot/repos/osxptb/beta/Psychtoolbox/Contents.m">beta</a> | view in <a href=
"http://svn.berlios.de/viewcvs/osxptb/beta/Psychtoolbox/Contents.m?view=markup">WebSVN with changelog</a></span>
</div>
<div class="code">
<code>Psychtoolbox/Contents.m</code>
</div>
""
Deletions:
%%(php;Path)Psychtoolbox/Contents.m%%


Revision [5959]

Edited on 2008-06-22 01:46:33 by DocBot
Additions:
* [[moglmorpher]]() -- A high-speed shape rendering and morphing function.
[[moglmorpher]] allows to quickly draw (=render) single 3D objects loaded by
use LoadOBJFile and [[moglmorpher]]. This demo was contributed by Quoc, C.
Deletions:
* moglmorpher() -- A high-speed shape rendering and morphing function.
moglmorpher allows to quickly draw (=render) single 3D objects loaded by
use LoadOBJFile and moglmorpher. This demo was contributed by Quoc, C.


Revision [3818]

Edited on 2008-03-21 11:23:24 by DocBot
Additions:
===[[PsychOpenGL]]===
==[[Psychtoolbox]]==
C or C""++"" code. This way you can code and use image manipulation
InitializeMatlabOpenGL; *before* calling [[Screen]]('OpenWindow', ...) the
Each time after calling a Psychtoolbox [[Screen]]() command for 2D drawing,
you need to call [[Screen]]('BeginOpenGL', window); to tell PTB that you want
with PTB again, you'll need to call [[Screen]]('EndOpenGL', window), so PTB
Psychtoolbox provides two [[Screen]] subfunctions that allow you to either
[[Screen]] Drawingcommands. See the [[Screen]] online help with...
[[Screen]] SetOpenGLTexture?
[[Screen]] GetOpenGLTexture?
img=imread(filename); tex=[[Screen]]('MakeTexture', win, img) methods and
=== Support for 3rd party OpenGL MEX-Files: ===
[[Screen]]('BeginOpenGL', win) and [[Screen]]('EndOpenGL',win) calls. Use the
[[Screen]]('[[Flip]]', win) command as usual to take care of stimlulus onset.
=== KNOWN LIMITATIONS: ===
significantly lower than when executing the same code from C or C""++"". This
=== CONTENTS: ===
%%(php;Path)Psychtoolbox/Contents.m%%
Deletions:
===PsychOpenGL===

C or C+ + code. This way you can code and use image manipulation










InitializeMatlabOpenGL; *before* calling Screen('OpenWindow', ...) the

Each time after calling a Psychtoolbox Screen() command for 2D drawing,
you need to call Screen('BeginOpenGL', window); to tell PTB that you want
with PTB again, you'll need to call Screen('EndOpenGL', window), so PTB

Psychtoolbox provides two Screen subfunctions that allow you to either
Screen Drawingcommands. See the Screen online help with...

Screen SetOpenGLTexture?
Screen GetOpenGLTexture?

img=imread(filename); tex=Screen('MakeTexture', win, img) methods and







Support for 3rd party OpenGL MEX-Files:

Screen('BeginOpenGL', win) and Screen('EndOpenGL',win) calls. Use the
Screen('Flip', win) command as usual to take care of stimlulus onset.


KNOWN LIMITATIONS:

significantly lower than when executing the same code from C or C+ +. This




CONTENTS:







PtbReference


Revision [2601]

Edited on 2008-03-16 00:00:00 by ZweiWolf
Additions:
C or C+ + code. This way you can code and use image manipulation
significantly lower than when executing the same code from C or C+ +. This
Deletions:
C or C\++ code. This way you can code and use image manipulation
significantly lower than when executing the same code from C or C\++. This


Revision [2600]

Edited on 2008-03-15 23:59:42 by ZweiWolf
Additions:
C or C\++ code. This way you can code and use image manipulation
significantly lower than when executing the same code from C or C\++. This
Deletions:
C or C++ code. This way you can code and use image manipulation
significantly lower than when executing the same code from C or C++. This


Revision [1112]

The oldest known version of this page was created on 2008-03-15 10:33:07 by DocBot
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0354 seconds