YUV to RGB conversion by fragment shader

后端 未结 5 1712
悲哀的现实
悲哀的现实 2020-11-30 01:10

I\'ve a problem with convertion of camera preview in Android from YUV format to RGB. The purpose of conversion is to apply some effects. I try to convert by fragment shader

5条回答
  •  天涯浪人
    2020-11-30 01:19

    Finally made your project display camera previews. I found 2 problems: 1. Before binding and changing surface characteristics you have to call GLES20.glActiveTexture(GLES20.surfacenumber); 2. More important and hidden problem is that GLES20.glTexImage2D() does not work with width and height, which are not power of 2 numbers. After loading texture with size, for example, 1024X1024, you should call GLES20.glTexSubImage2D()

    Good luck!

提交回复
热议问题