vstrakh: I see you're calling glTextureParameteri(), while passing GL_TEXTURE_2D as first argument. That's totally wrong.
Is it wrong? I do bind texture before calling glTextureParameteri. I use the function QOpenGLTexture::setMinMagFilters, which automatically binds the texure ID to GL_TEXTURE_2D
lawnjelly: I do the test using gl_FragColor = vec4(texture2D (matcapTexture, vec2(0.5, 0.5)).rgb, 1.0); it stil show the black screen. And I also put breakpoints in CodeXL when there's some OpenGL bugs, and it doesn't break anywhere. Could you suggest me some other tests?
JohnnyCode: I set up texture binding use three functions glActiveTexture(GL_TEXTURE0) ==> glBindTexture(GL_TEXTURE_2D) ==> glUniformi(3,0), where 3 is the location of texture sampler in shader program. you can see more details in the attached iamge.
C0lumbo: thank for your advice. I didn't know that pow need the base parameter to be postive. But when I changed the code as you said, it sill show black screen. Idon't think it's the problem because I tried to use the fixed texture coordinates for sampling the texutre earlier.