I try to create simple computer tomography viewer with OpenGL, data is 1D float array that represents single slice.
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, GL_LUMINANCE, GL_FLOAT, data);
Question
How to modify the colors/float values in fragment shader for the windowing purposes So displaying all values above some treshold as white and all below as black and the rest as greys between
my fragment shader
out vec4 FragColor;
in vec3 ourColor;
in vec2 TexCoord;
uniform sampler2D ourTexture;
void main()
{
FragColor = texture(ourTexture, TexCoord);
}
All works well yet I have some problems