# DrawDots size issue

**URL:** <https://psychtoolbox.discourse.group/t/drawdots-size-issue/4008>\
**Category:** Bugs & Features\
**Created:** [September 15, 2021, 6:54pm UTC](https://psychtoolbox.discourse.group/t/drawdots-size-issue/4008 "2021-09-15T18:54:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobhou](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@bobhou](https://psychtoolbox.discourse.group/u/bobhou)\
**Post date:** [September 15, 2021, 6:54pm UTC](https://psychtoolbox.discourse.group/t/drawdots-size-issue/4008/1 "2021-09-15T18:54:39Z")

</div>

I am not sure if it’s a bug, but

When I use the  
Screen(‘DrawDots’, …) with size=1 and dot\_type=4  
The dot size actually is 3x3.  
It seems it’s unable to have dots with size less than 3.

---

<div class="post-metadata">

**Author:** ![Ian-Max-Andolina](https://yyz2.discourse-cdn.com/free1/user_avatar/psychtoolbox.discourse.group/ian-max-andolina/32/4_2.png) [@Ian-Max-Andolina](https://psychtoolbox.discourse.group/u/Ian-Max-Andolina)\
**Post date:** [September 16, 2021, 6:47am UTC](https://psychtoolbox.discourse.group/t/drawdots-size-issue/4008/2 "2021-09-16T06:47:40Z")

</div>

Try `dot_type = 0` — this generates 1 pixel (as best I can tell) dots.

I can confirm with `dot_type = 4` it looks like 2pixels are always added on — also if you enter `size = 4` it uses 6 pixels, `size = 6` it uses 8 pixels etc. Dot type 4 is a fast option and so this may just be a limitation of whatever tricks Mario uses to get this optimisation. And always remember if you enable OpenGL blending and/or anti aliasing these pixel sizes may not be accurate due to anti-aliasing.

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [September 16, 2021, 3:03pm UTC](https://psychtoolbox.discourse.group/t/drawdots-size-issue/4008/3 "2021-09-16T15:03:54Z")

</div>

Rationale: It helps anti-aliased “round dots” quality:

> <https://github.com/Psychtoolbox-3/Psychtoolbox-3/commit/7f8a65c93d5ca2b02b11abbb4b993c57be7f1cf9#diff-2a3954f219138fd6ed2c43745923849c1e170109d56cfe1659504def94bad533>
>
> For shader-based drawing of alpha blending anti-aliased round
> dots, add a paddin…g of one pixel around the requested dot.
> 
> Draw the point-sprite "dot quad" with one extra pixel at each
> edge, then compensate for the extra pixel in the fragment
> shader. The idea is to avoid some hard 1 pixel premature cut off
> depending on dot location and gpu rasterization.
> 
> This seems to help quality as tested on a AMD GCN gpu.

-mario

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [September 16, 2021, 4:12pm UTC](https://psychtoolbox.discourse.group/t/drawdots-size-issue/4008/4 "2021-09-16T16:12:40Z")

</div>

Ofc. for type 4 it should still draw properly sized dots, so this may be a bug.  
Feel free to provide an authentication token for priority support (`help PsychPaidSupportAndServices`) and i’ll try to fix it for an upcoming beta release soon. Or file a bug report on our GitHub issue tracker with an exact description of the problem, symptoms, setup etc. etc. and i’ll look into it at some idle point in time in the future, maybe sometime next year. Or provide a well-tested high quality bug-fix yourself as GitHub pull request.

thanks,  
-mario
