[vtk-developers] [EXTERNAL] Software vs hardware interpolation

Moreland, Kenneth kmorel at sandia.gov
Wed Mar 21 10:21:45 EDT 2012

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.

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.

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.)

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?


From: "Kilgus, Thomas" <t.kilgus at Dkfz-Heidelberg.de<mailto:t.kilgus at Dkfz-Heidelberg.de>>
Date: Wed, 21 Mar 2012 14:24:39 +0100
To: "vtk-developers at vtk.org<mailto:vtk-developers at vtk.org>" <vtk-developers at vtk.org<mailto:vtk-developers at vtk.org>>
Subject: [EXTERNAL] [vtk-developers] Software vs hardware interpolation


as mentioned in my previous post (http://vtk.1045678.n5.nabble.com/software-rendering-td5557078.html ), I observed different interpolation behaviors in software and hardware rendering of images in VTK.

Here you can see an example: http://cdash.mitk.org/testDetails.php?test=2749290&build=107877

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.

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.)


_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtk-developers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20120321/ca3fba32/attachment.html>

More information about the vtk-developers mailing list