<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">To activate anti-aliasing, you can enable FXAA in the renderer using
<span style="font-size:8.0pt;font-family:Courier;color:#000096">renderer.UseFXAAOn()
</span>or set number of samples in the render window using <span style="font-size:8.0pt;font-family:Courier;color:#000096">
renderWindow.setMultiSamples(8)</span> (if you render in a Qt widget, adjust samples property in the window’s surface format -
<a href="http://doc.qt.io/qt-5/qsurfaceformat.html#setSamples">http://doc.qt.io/qt-5/qsurfaceformat.html#setSamples</a>). Anti-aliasing has impact on performance and may not be compatible with some rendering options.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Andras<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> vtkusers <vtkusers-bounces@vtk.org> <b>On Behalf Of
</b>Mohamed Amine Mzoughi<br>
<b>Sent:</b> Wednesday, December 26, 2018 10:38 AM<br>
<b>To:</b> Paulo Carvalho <paulo.r.m.carvalho@gmail.com>; vtkusers@public.kitware.com<br>
<b>Subject:</b> Re: [vtkusers] anti-aliasing<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hello again,<o:p></o:p></p>
<p>If I do that, the chart is not visible anymore (the Qt widget is all black), if I change the renderer of the vtkContextView also  (the Qt widget is all white) !<o:p></o:p></p>
<p>I give up for the moment !<o:p></o:p></p>
<p>ParaView is a such complex software, that I can't trace the stuff related to anti-alisaing in it (reverse engineering ParaView it is tough : a complex build system, many layers, proxies, in fact, it's an oriented object mix of a lasagna and spaghetti code
 !).<o:p></o:p></p>
<p>Thanks anyway.<o:p></o:p></p>
<div>
<p class="MsoNormal">Le 26/12/2018 à 16:02, Paulo Carvalho a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi, Mohammed,<o:p></o:p></p>
</div>
<p class="MsoNormal">   Strange indeed.  Did you create the vtkRender object yourself or you just used the default one returned by GetRenderer()?   If the latter is your case, I recommend creating your own vtkRender:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><br>
<span style="color:maroon">m_renderer</span><span style="color:silver"> </span>=<span style="color:silver">
</span><span style="color:purple">vtkSmartPointer</span><<span style="color:purple">vtkRenderer</span>>::<span style="color:#00677C">New</span>();<br>
<span style="color:maroon">m_renderer</span>-><i><span style="color:#00677C">UseFXAAOn</span></i>();<br>
<br>
    vtkFXAAOptions* const aaOpts = m_renderer->GetFXAAOptions();<br>
     aaOpts->SetRelativeContrastThreshold(0.125);<br>
     aaOpts->SetHardContrastThreshold(0.045);<br>
     aaOpts->SetSubpixelBlendLimit(0.75);<br>
     aaOpts->SetSubpixelContrastThreshold(0.25);<br>
     aaOpts->SetUseHighQualityEndpoints(true);<br>
     aaOpts->SetEndpointSearchIterations(12);<br>
<br>
<span style="color:maroon">m_view</span>-><i><span style="color:#00677C">GetRenderWindow</span></i>()-><i><span style="color:#00677C">AddRenderer</span></i>(<span style="color:maroon"> m_renderer</span> );<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">cheers,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Paulo<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Em qua, 26 de dez de 2018 às 12:15, Mohamed Amine Mzoughi <<a href="mailto:aminemzoughi@febus-optics.com">aminemzoughi@febus-optics.com</a>> escreveu:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p>Hello Paulo,<o:p></o:p></p>
<p>Even without SmoothingOn* instructions, I still have a problem in my 2D charts (I use a subclass of vtkChartXY, same issue with vtkHistogramChart2D, I have rectangles in screen).
<o:p></o:p></p>
<p>In ParaView, the line is smooth :<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><img border="0" width="1317" height="510" style="width:13.7222in;height:5.3125in" id="_x0000_i1025" src="cid:image001.png@01D49DF9.6FAAD070"><br>
whereas in my VTK app, it isn't :<br>
<br>
<img border="0" width="1107" height="194" style="width:11.5347in;height:2.0208in" id="_x0000_i1026" src="cid:image002.png@01D49DF9.6FAAD070"><br>
<br>
I don't know the issue...<br>
<br>
I'm calling the FXAA instructions before Render() in the constructor, I tried even to call them before each call to Render().<br>
<br>
Best regards.<o:p></o:p></p>
<div>
<p class="MsoNormal">Le 26/12/2018 à 14:21, Paulo Carvalho a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello, Mohamed!<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">  It seems that your last calls (*SmoothingOn()) conflict with UseFXAAOn().<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Here is the output I get when I add a call to PolygonSmoothingOn().  Not only it is not antialiased, but you can notice the edges triangle strips, visually ruining the results:<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><img border="0" width="561" height="354" style="width:5.8472in;height:3.6875in" id="_x0000_i1027" src="cid:image004.jpg@01D49DF9.6FAAD070" alt="image.png"><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">This one is rendered with only UseFXAAOn() and some configuration to the vtkFXAAOptions object like you did:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><img border="0" width="561" height="366" style="width:5.8472in;height:3.8125in" id="_x0000_i1028" src="cid:image006.jpg@01D49DF9.6FAAD070" alt="image.png"><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">kind regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Paulo<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Em qua, 26 de dez de 2018 às 10:03, Mohamed Amine Mzoughi <<a href="mailto:aminemzoughi@febus-optics.com" target="_blank">aminemzoughi@febus-optics.com</a>> escreveu:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hello,<br>
<br>
I want to enable Anti-alisaing in my VTK app, so I took some parameters <br>
from ParaView and it still doesn't work :<br>
<br>
     m_view->GetRenderer()->UseFXAAOn(); // enable AA<br>
<br>
     vtkFXAAOptions* const aaOpts = m_view->GetRenderer()->GetFXAAOptions();<br>
     aaOpts->SetRelativeContrastThreshold(0.125);<br>
     aaOpts->SetHardContrastThreshold(0.045);<br>
     aaOpts->SetSubpixelBlendLimit(0.75);<br>
     aaOpts->SetSubpixelContrastThreshold(0.25);<br>
     aaOpts->SetUseHighQualityEndpoints(true);<br>
     aaOpts->SetEndpointSearchIterations(12);<br>
<br>
what am I missing ?<br>
<br>
Also, m_view->GetRenderWindow()->GetMultiSamples() => returns 8.<br>
<br>
and I called also :<br>
<br>
m_view->GetRenderWindow()->LineSmoothingOn();<br>
m_view->GetRenderWindow()->PolygonSmoothingOn(); <br>
m_view->GetRenderWindow()->PointSmoothingOn();<br>
<br>
Thanks.<br>
<br>
_______________________________________________<br>
Powered by <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com&data=02%7C01%7Classo%40queensu.ca%7Cd59b33f462b04822b2bb08d66b4ac286%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636814366213770685&sdata=sS8BA%2FZ5H9Si5V4c90R1XjwY9sT0itroRaXSfGnnBx4%3D&reserved=0" target="_blank">
www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7Cd59b33f462b04822b2bb08d66b4ac286%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636814366213770685&sdata=PqpQ8CfjE3LqZfQXLA9l8Tm5OcCX83HbcL9V7vKx0wo%3D&reserved=0" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7Cd59b33f462b04822b2bb08d66b4ac286%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636814366213770685&sdata=VxgZVbYw8QhSn7qxaLPJgCvLUEKAeC5pNzD1xzkELwc%3D&reserved=0" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cd59b33f462b04822b2bb08d66b4ac286%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636814366213770685&sdata=3%2Fix16hWbHd5LDCE8iKhpgXAJ9Ild3qun947AmXTKls%3D&reserved=0" target="_blank">
http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cd59b33f462b04822b2bb08d66b4ac286%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636814366213770685&sdata=YYEcMFufeBBJPTWntI7le60pm8gK46aYFkALHtsJhjM%3D&reserved=0" target="_blank">https://vtk.org/mailman/listinfo/vtkusers</a><o:p></o:p></p>
</blockquote>
</div>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
</div>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>