# Multisampling doesn't work - why? \[Win7, PTB3, 2020a, TeamViewer\]

**URL:** <https://psychtoolbox.discourse.group/t/multisampling-doesnt-work-why-win7-ptb3-2020a-teamviewer/3266>\
**Category:** Programming Help\
**Created:** [June 17, 2020, 11:24am UTC](https://psychtoolbox.discourse.group/t/multisampling-doesnt-work-why-win7-ptb3-2020a-teamviewer/3266 "2020-06-17T11:24:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjaminmarkus](https://avatars.discourse-cdn.com/v4/letter/b/c57346/32.png) [@benjaminmarkus](https://psychtoolbox.discourse.group/u/benjaminmarkus)\
**Post date:** [June 17, 2020, 11:24am UTC](https://psychtoolbox.discourse.group/t/multisampling-doesnt-work-why-win7-ptb3-2020a-teamviewer/3266/1 "2020-06-17T11:24:58Z")

</div>

I’m drawing a set of polygons with the command  
Screen(‘FillPoly’, windowPtrNumber, color, polygonPoints)  
called as many times as many polygons I have. However, they are not anti-aliased, so I call  
PsychImaging(‘OpenWindow’, screenNumber, color,[],[],[],[],16)  
before, where ‘16’ serves as an input for multisampling. According to [this page](http://psychtoolbox.org/docs/Screen-OpenWindow) of the documentation and to the contents of ‘help AntiAliasing’ this should result in anti-aliased edges, however this is not happening. Why?

My setup is:

- PTB 3.0.16 - Flavor: beta - Corresponds to SVN Revision 10582
- Windows 7, Service Pack 1 (Version 6.1.7601)
- Matlab 9.8.0.1323502 (R2020a)

Additional info:

1. Before everything I call these too:  
PsychDefaultSetup(2)  
Screen(‘Preference’, ‘SkipSyncTests’, 1),  
the reason being is that I’m new to PTB and I copied code from my colleague’s code. Could these lines be the culprit? If yes, what should I change for multisampling to work?
2. Since I’m working remotely I am using TeamViewer to log into the system I’m using. This results in virtual screens being used by PTB. Could _this_ be the culprit?

---

<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:** [June 17, 2020, 12:36pm UTC](https://psychtoolbox.discourse.group/t/multisampling-doesnt-work-why-win7-ptb3-2020a-teamviewer/3266/2 "2020-06-17T12:36:22Z")

</div>

TeamViewer sounds like a likely cause.  
PTB tells you in its output if it could enable anti-aliasing and with how many samples (graphics card+driver dependent).

Try if this way of opening a window works to defeat TeamViewer if that would be the culprit:

PsychImaging(‘PrepareConfiguration’);  
PsychImaging(‘AddTask’,‘General’,‘UseVirtualFramebuffer’);  
win = PsychImaging(‘OpenWindow’, screenNumber, color,[],[],[],[],16)

---

<div class="post-metadata">

**Author:** ![benjaminmarkus](https://avatars.discourse-cdn.com/v4/letter/b/c57346/32.png) [@benjaminmarkus](https://psychtoolbox.discourse.group/u/benjaminmarkus)\
**Post date:** [June 17, 2020, 1:11pm UTC](https://psychtoolbox.discourse.group/t/multisampling-doesnt-work-why-win7-ptb3-2020a-teamviewer/3266/3 "2020-06-17T13:11:29Z")

</div>

Yup, it worked! Many thanks! 🙂
