2

I have a program which requires the use of the DrawDots function:

[minSmoothPointSize, maxSmoothPointSize, minAliasedPointSize, maxAliasedPointSize] =
Screen('DrawDots', windowPtr, xy [,size] [,color] [,center] [,dot_type][, lenient]);

My line of code looks like this: Screen('DrawDots', scr,[x,y],r*2,color,[],2)

However, when I run the code I get the following error related to this function:

PTB-ERROR: You requested a point size of 49.200000 units, which is not in the range (1.000000 to 20.000000) supported by your graphics hardware.
Error in function DrawDots:     Usage error
Unsupported point size requested in Screen('DrawDots').

The computer I am running this on is brand new, but only has an integrated graphics card (Intel UHD Graphics 630). However, the code works on other computers with a lower quality integrated graphics cards with no problem (Intel HD Graphics 620), so I am wondering if there is some other issue going on.

I have tried switching Matlab to run off of OpenGL rather than the graphics card itself, but that did not work and I got the same error. And, I tried running the program when the OS was set to a lower screen resolution, but that also didn't work. I am running Matlab 2016b on all of the PCs I have tested the code on.

Any suggestions for how to get around this issue would be much appreciated. Thank you.

Ander Biguri
  • 35,140
  • 11
  • 74
  • 120
  • What about using point sized in the range (1.000000 to 20.000000) – Ander Biguri Feb 05 '19 at 18:07
  • 1
    If I do that then the circles will be too small relative to the rest of the objects on the screen (and possibly just too small in general). The code is designed such that everything is sized relative to the screen resolution, so if I set the circles to a constant size I think it would look weird. I can try that as a last resort but I was hoping to maintain the original circle size. – BK Ashinoff Feb 05 '19 at 20:23
  • Looking at the code where this errors, I'd say that you have high chances of fixing the problem if you update your graphic card drivers/OpenGL – Ander Biguri Feb 06 '19 at 08:59
  • I have tried updating both, but no luck. :( – BK Ashinoff Feb 06 '19 at 15:51
  • The code to throw this error ask the GPU what is the biggest point it can draw, and then trows an error if yous is bigger, giving you the GPU limits. Unfortunately there is no other option, if your GPU says that it can not draw more than 20, it can not. However, the fact that a similar GPU can run the code really suggests OpenGL version mismatch. Can you check which version each of those GPUs are running? – Ander Biguri Feb 06 '19 at 15:53
  • It looks like the computers that the code works on use the same version of Open GL (4.5.0), but a different build (23.29.16.5018). The code that doesn't work is using build 24.20.100.6287, which seems to refer to the use of different Renderer Drivers. I am trying to figure out now how to "downgrade" OpenGL and the drivers to match the computers where the code works. – BK Ashinoff Feb 06 '19 at 18:07

1 Answers1

2

Two suggestions to try:

1) Use the Psychtoolbox Shader implementation (use '3', instead of '2' in final parameter to the DrawDots call):

Screen('DrawDots', scr,[x,y],r*2,color,[],3)

2) Use the FillOval function instead, though this requires 4 parameters for each dot (since FillOval can also draw ovals which aren't circles), so note the difference when specifying the coordinates:

 Screen('FillOval', scr, color, CenterRectOnPointd([0 0 r*2 r*2], x, y));

I'm not sure if you're trying to plot a single dot, or multiple dots in one call, but DrawDots and FillOval also differ slightly in how the parameters of the multiple dots are specified.

DMR
  • 1,479
  • 1
  • 8
  • 11
  • Using the Psychtoolbox Shader worked! It completely fixed the problem. I have no idea why, but It works! Thank you! – BK Ashinoff Feb 06 '19 at 18:27