<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>I don't claim to be an expert here, but the interpolation method (nearest vs. linear) is controlled via an OpenGL flag to glTexParameter.  If VTK is not properly setting this flag, this could be a bug, but a look at vtkOpenGLTexture looks as if the flag
 should be set correctly.</div>
</div>
</div>
<div><br>
</div>
<div>Traditionally (circa 15 years ago) the nearest lookup was considered faster and the linear lookup was considered more accurate.  Nowadays, graphics cards have special interpolating hardware in their texture units that allows them to do the linear interpolation
 with no extra time cost.  It could be that the driver for this particular hardware is doing the linear interpolation anyway since there is no added time cost.</div>
<div><br>
</div>
<div>VTK has been dealing with rendering difference between software and hardware rendering as well as differences between different hardware architectures for, like, ever.  Thus, the VTK testing framework accepts multiple valid images for any test.  You just
 add image files with the same name but with _1, _2, etc. added to the filename.  (There are lots of examples in the existing baselines.)</div>
<div><br>
</div>
<div>So, the easy solution is just to check in a new image into the baseline image repository.  The real question is, how much do you really care that you are getting linear instead of nearest interpolation?  Do you have a use case other than this pathological
 test?</div>
<div><br>
</div>
<div>-Ken</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>"Kilgus, Thomas" <<a href="mailto:t.kilgus@Dkfz-Heidelberg.de">t.kilgus@Dkfz-Heidelberg.de</a>><br>
<span style="font-weight:bold">Date: </span>Wed, 21 Mar 2012 14:24:39 +0100<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>" <<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>><br>
<span style="font-weight:bold">Subject: </span>[EXTERNAL] [vtk-developers] Software vs hardware interpolation<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div 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">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@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:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
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;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
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]-->
<div lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">as mentioned in my previous post<span style="color:#1F497D"> (</span></span><a href="http://vtk.1045678.n5.nabble.com/software-rendering-td5557078.html"><span lang="EN-US">http://vtk.1045678.n5.nabble.com/software-rendering-td5557078.html</span></a><span lang="EN-US">
 ), I observed different interpolation behaviors in software and hardware rendering of images in VTK.   <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Here you can see an example: <a href="http://cdash.mitk.org/testDetails.php?test=2749290&build=107877">
http://cdash.mitk.org/testDetails.php?test=2749290&build=107877</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The test shows the result of an image rendered with software rendering. The input 5x5 pixel image is scaled (interpolated) to 8x8. If you render the same image with hardware support, a nearest neighbor interpolation will
 be applied and the result will look like the ValidImage on the bottom of the page. I don’t think that any interpolation can be considered wrong or right, but I think both, software and hardware rendering, should have a common default behavior.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Please can anyone comment on this? Is there any possibility to enforce the same interpolation in software rendering? For reliable testing in different environments it is necessary both rendering methods act with the same
 default behavior, since it is not deterministic whether your machine is able to render with hardware support or with software rendering. (For instance a VPN connection established to a windows machine blocks the GPU for some reason, Virtual Machines show different
 behavior etc.)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thomas<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at
<a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a> Follow this link to subscribe/unsubscribe:
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a>
</blockquote>
</span>
</body>
</html>