Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #1 
Are there any instructions for integrating The Psychtoolbox with ML?
Does it replace XGL for generating graphics?
0
Wael.Asaad

Administrator
Registered:
Posts: 51
Reply with quote  #2 
It is a replacement for XGL, but development was stopped once we realized the cycle times were much slower.  Dave and his gang at UofC have the latest code for that version, but it's not simply a drop-in replacement as I call (required some core changes to ML).
0
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #3 
I imagine you need to modify/replace mlvideo.m to use psychtoolbox or any other graphics library. mlvideo.m is a monkey logic wrapper object for handling video stimulus presentation and controlling the graphics display. Currently it wraps XGL, but it could wrap psychtoolbox or other similar libraries. Here's another psychophysics library I heard good things about, but I don't know what impact it will have on timing.

http://gru.stanford.edu/doku.php/mgl/overview

0
Jaewon

Administrator
Registered:
Posts: 971
Reply with quote  #4 
My understanding is that all of these graphic libraries depend on DirectX or OpenGL, so it is hard to believe that the low performance is due to the libraries themselves, unless they are programmed so badly. I think the bottleneck is more likely in converting the stimulus format into the one that each library is designed for. Another thing to consider is how flipping is executed. When I tested ML 3-4 years ago (I don't remember whether the graphic library of ML was SVI or XGL at that time), I noticed that the flip command returned the control immediately after being executed. However, DirectX has a couple of different flipping options (at least version 8) and, with one of them, you can make DirectX not return the control until flipping actually occurs during the vertical blank time. If the screen was flipped in that way, the cycle time would be reduced to the screen refresh rate.

It is difficult to know all the details of how each graphic library works, unless it is well-documented. So, if we decide to move onto another library, I suggest riding on one of the open-source projects that has a long development history and supports multi-platform such as SDL (https://www.libsdl.org/).

0
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #5 
SDL is great, but I was thinking to stick with XGL for now, and add a windowed screen options to use for debugging. This may solve the clicking outside the control window problem.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.