0

Android uses Opengles to draw a 1080 screen on a 320x240 screen, and the preview will have moiré. Is there any way to solve it. Setting GL_TEXTURE_MIN_FILTER has no effect.

    public static int createCameraTexture() {
    int[] texture = new int[1];
    GLES30.glGenTextures(1, texture, 0);
    GLES30.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, texture[0]);
    GLES30.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);
    GLES30.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);

    GLES30.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
    GLES30.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);

    GLES30.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, 0);
    return texture[0];
}
W.MHui
  • 1
  • 2
  • Have you tried using some form of multisampling as stated at?: https://stackoverflow.com/questions/46386807/c-removing-moire-effect-from-opengl – BBacon Nov 26 '20 at 11:34
  • Where do you generate the mipmaps? ([`glGenerateMipmap`](https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glGenerateMipmap.xhtml)) – Rabbid76 Nov 26 '20 at 15:19

0 Answers0