[vtkusers] vtkMapper::InterpolateScalarsBeforeMapping and off-screen rendering

Andreas Buykx A.Buykx at tnodiana.com
Mon Oct 5 08:56:44 EDT 2015


Hi all,

I have an issue with color mapping using scalar-interpolation-before-mapping, while rendering off-screen. The attached python script demonstrates the issue. The script defines a bar with linear increasing point-scalars. These are then rendered using a lookup table containing four colors. This work fine when rendering on-screen, but off-screen the number of colors is larger than the number of colors in the on-screen image. This problem occurs with VTK6.3.0 on both windows and linux (using vncserver) platforms. With VTK6.2.0 we saw the same anomaly but only on our windows machines.

Debugging (on Linux + VNC server) I found that the root cause of this difference seems to be vtkOpenGLTexture, which will determine whether non-power-of-two textures are supported. If not it will resample the texture map to increase the number of textures to a power of two. I suspect this resampling produces the additional colors.
I registered this in the bug tracker (issue 15734<http://www.vtk.org/Bug/view.php?id=15734>) and reported the OpenGL capabilities there.

When I load the data into ParaView 4.3.1 (on windows) however, I can render the image, and also save a screen shot that shows the proper color mapping, so apparently it is possible after all.

This issue is at the moment blocking our transition to VTK6.3.0 (which we need because it contains fixes to some other issues) because image tests use the off-screen rendering feature. Could someone please help to determine a workaround or fix, and/or explain how ParaView manages to get the color mapping right?

Thanks a lot for your help!

Andreas


____________________________________________________________
TNO DIANA BV is a limited liability company registered in the trade register of the Chamber of Commerce as TNO DIANA BV with registered number 27252655.
____________________________________________________________
This e-mail and its contents are subject to the DISCLAIMER at http://tnodiana.com/content/Disclaimer
____________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151005/e6ac7daf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: onscreen.png
Type: image/png
Size: 43851 bytes
Desc: onscreen.png
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151005/e6ac7daf/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: offscreen.png
Type: image/png
Size: 835 bytes
Desc: offscreen.png
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151005/e6ac7daf/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: colormapping.py
Type: application/octet-stream
Size: 3620 bytes
Desc: colormapping.py
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151005/e6ac7daf/attachment.obj>


More information about the vtkusers mailing list