当前位置: 首页>>代码示例>>Java>>正文


Java GLES20.GL_TEXTURE5属性代码示例

本文整理汇总了Java中android.opengl.GLES20.GL_TEXTURE5属性的典型用法代码示例。如果您正苦于以下问题:Java GLES20.GL_TEXTURE5属性的具体用法?Java GLES20.GL_TEXTURE5怎么用?Java GLES20.GL_TEXTURE5使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.opengl.GLES20的用法示例。


在下文中一共展示了GLES20.GL_TEXTURE5属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onDraw

@Override
public void onDraw(int cameraTexId, int canvasWidth, int canvasHeight) {
    // TODO move?
    if (bufA == null || bufA.getWidth() != canvasWidth || bufB.getHeight() != canvasHeight) {
        // Create new textures for buffering
        bufA = new RenderBuffer(canvasWidth, canvasHeight, GLES20.GL_TEXTURE4);
        bufB = new RenderBuffer(canvasWidth, canvasHeight, GLES20.GL_TEXTURE5);
        bufC = new RenderBuffer(canvasWidth, canvasHeight, GLES20.GL_TEXTURE6);
    }

    // Render to buf a
    setupShaderInputs(programA,
            new int[]{canvasWidth, canvasHeight},
            new int[]{cameraTexId, bufA.getTexId()},
            new int[][]{new int[]{canvasWidth, canvasHeight}, new int[]{canvasWidth, canvasHeight}});
    bufA.bind();
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
    bufA.unbind();
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);


    // Render to buf b
    setupShaderInputs(programB,
            new int[]{canvasWidth, canvasHeight},
            new int[]{bufB.getTexId(), bufA.getTexId()},
            new int[][]{new int[]{canvasWidth, canvasHeight}, new int[]{canvasWidth, canvasHeight}});
    bufB.bind();
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
    bufB.unbind();
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);


    // Render to buf c
    setupShaderInputs(programC,
            new int[]{canvasWidth, canvasHeight},
            new int[]{bufC.getTexId(), bufB.getTexId()},
            new int[][]{new int[]{canvasWidth, canvasHeight}, new int[]{canvasWidth, canvasHeight}});
    bufC.bind();
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
    bufC.unbind();
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);


    // Render to screen
    setupShaderInputs(programImg,
            new int[]{canvasWidth, canvasHeight},
            new int[]{bufC.getTexId(), bufA.getTexId()},
            new int[][]{new int[]{canvasWidth, canvasHeight}, new int[]{canvasWidth, canvasHeight}});
    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
}
 
开发者ID:SimonCherryGZ,项目名称:face-landmark-android,代码行数:53,代码来源:JFAVoronoiFilter.java


注:本文中的android.opengl.GLES20.GL_TEXTURE5属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。