<div dir="ltr">Folks, <div><br></div><div>While looking into some failing test on Linux, we realized this code below in vtkOpenGLRenderWindow </div><div><br></div><div><div>// Initialize static member that controls global maximum number of multisamples</div>
<div>// (off by default on Apple because it causes problems on some Mac models).</div><div>#if defined(__APPLE__)</div><div>static int vtkOpenGLRenderWindowGlobalMaximumNumberOfMultiSamples = 0;</div><div>#else</div><div>
static int vtkOpenGLRenderWindowGlobalMaximumNumberOfMultiSamples = 8;</div><div>#endif</div></div><div><br></div><div><br></div><div>and in vtkXOpenGLRenderWindow.cxx</div><div><div>if (multisamples)</div><div>    {</div>
<div>#ifdef GLX_SAMPLE_BUFFERS_SGIS</div><div>    attributes[index++] = GLX_SAMPLE_BUFFERS_SGIS;</div><div>    attributes[index++] = 1;</div><div>    attributes[index++] = GLX_SAMPLES_SGIS;</div><div>    attributes[index++] = multisamples;</div>
<div>#endif</div><div>    }</div><div><br></div><div>Basically in OpenGL, we can achieve anti-aliasing for each primitive type by invoking enable / disable on <font color="#000000">GL_POINT_SMOOTH, GL_LINE_SMOOTH or GL_POLYGON_SMOOTH. The other route that applies anti-aliasing to all of the primitives is to use mutli-sampling if available (this always wins if both methods are used). Now by default, on LINUX (the code above set the sample size to 0 effectively disabling anti-aliasing) we have anti-aliasing ON with a sample size of 8. The anti-aliasing is an expensive operation and not all of the implementation supports it (Please refer to the documentation on </font>GLX_SAMPLES_SGIS or <span style="color:rgb(0,0,0);white-space:pre-wrap">ARB_multisample). </span></div>
<div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><font color="#000000"><span style="white-space:pre-wrap">I am asking if we should set the sample size to 0 default on Linux as well (like Mac) and if applications needs it then they can explicitly turn it ON. I can make an argument for either side but I am bit more inclined towards setting it to 0 so that applications can still control it if wanted but if not they won't get it by default (and will get better performance overall). </span></font></div>
<div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">Now we don't agree on this, can we agree on setting to 0 for testing (May be via environment variable like others we used in our testing?)</span></font></div>
<div><br></div><div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">Thoughts? </span></font></div><div><font color="#000000"><span style="white-space:pre-wrap"><br>
</span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">Helpful links: </span></font></div><div><a href="http://www.opengl.org/registry/specs/ARB/multisample.txt">http://www.opengl.org/registry/specs/ARB/multisample.txt</a></div>
<div><a href="http://www.opengl.org/registry/specs/SGIS/multisample.txt">http://www.opengl.org/registry/specs/SGIS/multisample.txt</a><br></div><div><a href="http://www.opengl.org/wiki/Multisampling">http://www.opengl.org/wiki/Multisampling</a><br>
</div><div><br></div><div><br></div><div><font color="#000000"><span style="white-space:pre-wrap">- Aashish</span></font></div><div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div><br>
</div><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer         <br>| Kitware Inc.            <br>| <a href="http://www.kitware.com">www.kitware.com</a>    
</div></div>