diff --git a/imagewidget.cpp b/imagewidget.cpp index 3f5ca8a..7bd69a0 100644 --- a/imagewidget.cpp +++ b/imagewidget.cpp @@ -777,7 +777,7 @@ void ImageWidgetGL::initializeGL() m_lut->bind(2); QImage colormap = loadColormap(); - m_colormap = std::make_unique(QOpenGLTexture::Target1DArray); + m_colormap = std::make_unique(QOpenGLTexture::Target2DArray); m_colormap->setSize(colormap.width()); m_colormap->setLayers(colormap.height()); m_colormap->setFormat(QOpenGLTexture::RGBA8_UNorm); diff --git a/shaders/image.frag b/shaders/image.frag index e311e7e..3c7a801 100644 --- a/shaders/image.frag +++ b/shaders/image.frag @@ -1,6 +1,6 @@ uniform sampler2D qt_Texture0; uniform sampler3D lut_table; -uniform sampler1DArray colormap; +uniform sampler2DArray colormap; uniform vec3 mtf_param[3]; uniform vec2 unit_scale; uniform bool bw; @@ -30,7 +30,7 @@ vec3 falsecolor(float color) { color *= 255.0 / 256.0; color += 0.5 / 256.0; - return texture(colormap, vec2(color, colormapIdx)).rgb; + return texture(colormap, vec3(color, 0.5, colormapIdx)).rgb; } vec3 checker()