Skip to content

Add support for direct loading of 16-bits and floating textures

16-bits textures are common in PNG format.
When using direct scalar mode, VTK was expecting values to be in the range [0-255], ignoring the high byte value and these values were copied to unsigned char 8-bit array.
This was leading to undefined behavior when values were greater than 255, a loss of precision, and an unnecessary copy.
The array is now directly uploaded to a GL_RGB16 or GL_RGBA16 OpenGL texture.

32-bits floating textures can be useful for HDRI environment maps.
For a float array, VTK was expecting values to be in the range [0.0, 1.0], and converted it to an unsigned char array, leading to a loss of precision and ignoring values greater than 1.0 (reducing contrast for HDR textures).
The array is now directly uploaded, without conversion, to a GL_RGB32F or GL_RGBA32F OpenGL texture.

Related: paraview/paraview#19203 (closed)

Edited by Michael Migliore

Merge request reports