OpenGL ES 2.0 render to texture

后端 未结 4 1582
予麋鹿
予麋鹿 2020-12-15 08:25

I\'m trying to render to a texture using OpenGL ES 2.0, but I can\'t seem to make it work.

This is how I proceed:

    struct RenderTexture
    {
             


        
4条回答
  •  遥遥无期
    2020-12-15 08:56

    I had exact the same problem as u do. Try to add

    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    

    right after glBindTexture(GL_TEXTURE_2D, tex); and black square have to disappear.

提交回复
热议问题