문제

I use Qt 4.7 whith openGL es2 , the hardwar is powervr ,sdk is sgx 4.8

glBindTexture( GL_TEXTURE_2D, bindTexture(m_myPixmapOfPic, GL_TEXTURE_2D));

When picture size is 512*256, it works well.When picture is 768*512, shows black which means failed.I try to find interface and increase the size of buffer of texture.But Qt doesnot support such interface.OpenGL es2 interfaces also do not mention this problem.

   QVector<QVector3D> vertices.append
   QVector<QVector2D> texCoords.append

glBindTexture( GL_TEXTURE_2D, bindTexture(m_myPixmapOfPic, GL_TEXTURE_2D));

GLSL:gl_FragColor = texture2D(texture, v_texcoord) //simple bind
도움이 되었습니까?

해결책

This is not due to buffer size. You may need to specify a power-of-two (ie 2^n - 2,4,16,32,64,128,256, 512, 1024 etc) sized image as texture. Alternatively the HW needs to support extensions for NON-power of two.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top