I simply changedThe texture creation code
glGenTextures(1, &m_FluorShadersParams[fpsFused].m_LutTexture);
glBindTexture(GL_TEXTURE_2D, m_FluorShadersParams[fpsFused].m_LutTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glActiveTexture(FluorTextureIndexes[fpsFused]);
glBindTexture(GL_TEXTURE_2D, m_FluorShadersParams[fpsFused].m_LutTexture);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, 0);
Filling the texture with data
glActiveTexture(a_FluorTextureIndexes[fpsFused]);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, i, 256, 1, GL_RGBA, GL_UNSIGNED_BYTE, pLUT);
glActiveTexture(GL_TEXTURE0);
Calling the shader
glUseProgram(m_progObj[fsFluorFused]);
glActiveTexture(FluorTextureIndexes[fpsFused]);
glBindTexture(GL_TEXTURE_2D, FluorTextureIndexesNum[fpsFused]);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, inputTextures[eftIR]); // Fluor image
glBindFramebuffer(GL_FRAMEBUFFER,outputFBO.m_FBO[eftFused]);
uniformLoc = glGetUniformLocation(m_progObj[fsFluorFused], "FluorImage");
if (uniformLoc != -1)
{
glUniform1i(uniformLoc, 1);
}
uniformLoc = glGetUniformLocation(m_progObj[fsFluorFused], "FluorColorLutRGBA");
if (uniformLoc != -1)
{
glUniform1i(uniformLoc, FluorTextureIndexesNum[fpsFused]);
}
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_QUADS);
glTexCoord2f(0, fTextureRatioY);
glVertex2f(0, fTextureRatioY);
glTexCoord2f(fTextureRatioX, fTextureRatioY);
glVertex2f(fTextureRatioX, fTextureRatioY);
glTexCoord2f(fTextureRatioX, 0);
glVertex2f(fTextureRatioX, 0);
glTexCoord2f(0, 0);
glVertex2f(0, 0);
glEnd();
glUseProgram(0);
glActiveTexture(GL_TEXTURE0);
glBindFramebuffer(GL_FRAMEBUFFER,0);
glBindTexture(GL_TEXTURE_2D,0);
The strange thing is that if i change all the places in the c++ code back from Texture1D into Texture2D into Texture1D and updated the size ofsampler in the textureshader to be 256x11D everything works great.
Anyone has any idea where the issue can be?