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


Java GLES20.glFramebufferTexture2D方法代码示例

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


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

示例1: createFrameBuffer

import android.opengl.GLES20; //导入方法依赖的package包/类
/**
 * 创建FrameBuffer
 * @param hasRenderBuffer 是否启用RenderBuffer
 * @param width 宽度
 * @param height 高度
 * @param texType 类型,一般为{@link GLES20#GL_TEXTURE_2D}
 * @param texFormat 纹理格式,一般为{@link GLES20#GL_RGBA}、{@link GLES20#GL_RGB}等
 * @param minParams 纹理的缩小过滤参数
 * @param maxParams 纹理的放大过滤参数
 * @param wrapS 纹理的S环绕参数
 * @param wrapT 纹理的W环绕参数
 * @return 创建结果,0表示成功,其他值为GL错误
 */
public int createFrameBuffer(boolean hasRenderBuffer,int width,int height,int texType,int texFormat,
                             int minParams,int maxParams,int wrapS,int wrapT){
    mFrameTemp=new int[4];
    GLES20.glGenFramebuffers(1,mFrameTemp,0);
    GLES20.glGenTextures(1,mFrameTemp,1);
    GLES20.glBindTexture(texType,mFrameTemp[1]);
    GLES20.glTexImage2D(texType, 0,texFormat, width, height,
            0, texFormat, GLES20.GL_UNSIGNED_BYTE, null);
    //设置缩小过滤为使用纹理中坐标最接近的一个像素的颜色作为需要绘制的像素颜色
    GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_MIN_FILTER,minParams);
    //设置放大过滤为使用纹理中坐标最接近的若干个颜色,通过加权平均算法得到需要绘制的像素颜色
    GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_MAG_FILTER,maxParams);
    //设置环绕方向S,截取纹理坐标到[1/2n,1-1/2n]。将导致永远不会与border融合
    GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_WRAP_S,wrapS);
    //设置环绕方向T,截取纹理坐标到[1/2n,1-1/2n]。将导致永远不会与border融合
    GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_WRAP_T,wrapT);

    GLES20.glGetIntegerv(GLES20.GL_FRAMEBUFFER_BINDING,mFrameTemp,3);
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER,mFrameTemp[0]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
            texType, mFrameTemp[1], 0);
    if(hasRenderBuffer){
        GLES20.glGenRenderbuffers(1,mFrameTemp,2);
        GLES20.glBindRenderbuffer(GLES20.GL_RENDERBUFFER,mFrameTemp[2]);
        GLES20.glRenderbufferStorage(GLES20.GL_RENDERBUFFER,GLES20.GL_DEPTH_COMPONENT16,width,height);
        GLES20.glFramebufferRenderbuffer(GLES20.GL_FRAMEBUFFER,GLES20.GL_DEPTH_ATTACHMENT,GLES20.GL_RENDERBUFFER,mFrameTemp[2]);
    }
    return GLES20.glGetError();
}
 
开发者ID:aiyaapp,项目名称:AAVT,代码行数:43,代码来源:FrameBuffer.java

示例2: createFrameBuffer

import android.opengl.GLES20; //导入方法依赖的package包/类
public void createFrameBuffer(int width, int height, int[] frameBuffer, int[] frameBufferTexture, int frameBufferSize) {
    for (int i = 0; i < frameBufferSize; i++) {

        GLES20.glGenTextures(1, frameBufferTexture, i);
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, frameBufferTexture[i]);
        GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0,
                GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);

        GLES20.glGenFramebuffers(1, frameBuffer, i);
        GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, frameBuffer[i]);
        GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
                GLES20.GL_TEXTURE_2D, frameBufferTexture[i], 0);

        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
        GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
    }
}
 
开发者ID:lzmlsfe,项目名称:19porn,代码行数:26,代码来源:SurfaceRenderer.java

示例3: drawSharpenPass

import android.opengl.GLES20; //导入方法依赖的package包/类
private void drawSharpenPass() {
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, renderFrameBuffer[0]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, renderTexture[0], 0);
    GLES20.glClear(0);

    GLES20.glUseProgram(sharpenShaderProgram);
    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, renderTexture[1]);
    GLES20.glUniform1i(sharpenSourceImageHandle, 0);
    if (showOriginal) {
        GLES20.glUniform1f(sharpenHandle, 0);
    } else {
        GLES20.glUniform1f(sharpenHandle, getSharpenValue());
    }
    GLES20.glUniform1f(sharpenWidthHandle, renderBufferWidth);
    GLES20.glUniform1f(sharpenHeightHandle, renderBufferHeight);
    GLES20.glEnableVertexAttribArray(sharpenInputTexCoordHandle);
    GLES20.glVertexAttribPointer(sharpenInputTexCoordHandle, 2, GLES20.GL_FLOAT, false, 8, textureBuffer);
    GLES20.glEnableVertexAttribArray(sharpenPositionHandle);
    GLES20.glVertexAttribPointer(sharpenPositionHandle, 2, GLES20.GL_FLOAT, false, 8, vertexInvertBuffer);
    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:23,代码来源:PhotoFilterView.java

示例4: initFBO

import android.opengl.GLES20; //导入方法依赖的package包/类
private void initFBO(int width, int height)
{
    Log.d(LOGTAG, "initFBO("+width+"x"+height+")");

    deleteFBO();

    GLES20.glGenTextures(1, texDraw, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texDraw[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

    GLES20.glGenTextures(1, texFBO, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texFBO[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

    //int hFBO;
    GLES20.glGenFramebuffers(1, FBO, 0);
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, FBO[0]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, texFBO[0], 0);
    Log.d(LOGTAG, "initFBO error status: " + GLES20.glGetError());

    int FBOstatus = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
    if (FBOstatus != GLES20.GL_FRAMEBUFFER_COMPLETE)
        Log.e(LOGTAG, "initFBO failed, status: " + FBOstatus);

    mFBOWidth  = width;
    mFBOHeight = height;
}
 
开发者ID:vulovicv23,项目名称:opencv-documentscanner-android,代码行数:36,代码来源:CameraGLRendererBase.java

示例5: createEffectTexture

import android.opengl.GLES20; //导入方法依赖的package包/类
private void createEffectTexture() {
    AndroidUntil.checkGlError("initFBO_S");
    GLES20.glGenFramebuffers(1, mFboId, 0);
    GLES20.glGenRenderbuffers(1, mRboId, 0);
    GLES20.glGenTextures(1, mTexId, 0);

    GLES20.glBindRenderbuffer(GLES20.GL_RENDERBUFFER, mRboId[0]);
    GLES20.glRenderbufferStorage(GLES20.GL_RENDERBUFFER,
            GLES20.GL_DEPTH_COMPONENT16, mWidth, mHeight);

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFboId[0]);
    GLES20.glFramebufferRenderbuffer(GLES20.GL_FRAMEBUFFER,
            GLES20.GL_DEPTH_ATTACHMENT, GLES20.GL_RENDERBUFFER, mRboId[0]);

    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTexId[0]);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,
            GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,
            GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,
            GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,
            GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);

    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA,
            mWidth, mHeight, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);

    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER,
            GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, mTexId[0], 0);

    if (GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER) !=
            GLES20.GL_FRAMEBUFFER_COMPLETE) {
        throw new RuntimeException("glCheckFramebufferStatus()");
    }
    AndroidUntil.checkGlError("initFBO_E");
}
 
开发者ID:wuyisheng,项目名称:libRtmp,代码行数:38,代码来源:Effect.java

示例6: bind

import android.opengl.GLES20; //导入方法依赖的package包/类
public void bind() {
    GLES20.glViewport(0, 0, width, height);

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, frameBufferId);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
            GLES20.GL_TEXTURE_2D, texId, 0);
    GLES20.glFramebufferRenderbuffer(GLES20.GL_FRAMEBUFFER, GLES20.GL_DEPTH_ATTACHMENT,
            GLES20.GL_RENDERBUFFER, renderBufferId);
}
 
开发者ID:SimonCherryGZ,项目名称:face-landmark-android,代码行数:10,代码来源:RenderBuffer.java

示例7: create

import android.opengl.GLES20; //导入方法依赖的package包/类
FBO create(int width,int height){
    int[] frameBuffers = new int[1];
    int[] frameBufferTextures = new int[1];
    GLES20.glGenFramebuffers(1, frameBuffers, 0);

    GLES20.glGenTextures(1, frameBufferTextures, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, frameBufferTextures[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA,
            width,height, 0,
            GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
            GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
            GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
            GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
            GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, frameBuffers[0]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
            GLES20.GL_TEXTURE_2D, frameBufferTextures[0], 0);

    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);

    frameBuffer=frameBuffers[0];
    frameBufferTexture=frameBufferTextures[0];
    return this;
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:31,代码来源:FBO.java

示例8: notifyCallbacks

import android.opengl.GLES20; //导入方法依赖的package包/类
private void notifyCallbacks(VideoRenderer.I420Frame frame, float[] texMatrix) {
  // Make temporary copy of callback list to avoid ConcurrentModificationException, in case
  // callbacks call addFramelistener or removeFrameListener.
  final ArrayList<FrameListenerAndParams> tmpList;
  if (frameListeners.isEmpty())
    return;
  tmpList = new ArrayList<>(frameListeners);
  frameListeners.clear();

  final float[] bitmapMatrix = RendererCommon.multiplyMatrices(
      RendererCommon.multiplyMatrices(texMatrix,
          mirror ? RendererCommon.horizontalFlipMatrix() : RendererCommon.identityMatrix()),
      RendererCommon.verticalFlipMatrix());

  for (FrameListenerAndParams listenerAndParams : tmpList) {
    final int scaledWidth = (int) (listenerAndParams.scale * frame.rotatedWidth());
    final int scaledHeight = (int) (listenerAndParams.scale * frame.rotatedHeight());

    if (scaledWidth == 0 || scaledHeight == 0) {
      listenerAndParams.listener.onFrame(null);
      continue;
    }

    if (bitmapTextureFramebuffer == null) {
      bitmapTextureFramebuffer = new GlTextureFrameBuffer(GLES20.GL_RGBA);
    }
    bitmapTextureFramebuffer.setSize(scaledWidth, scaledHeight);

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, bitmapTextureFramebuffer.getFrameBufferId());
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
        GLES20.GL_TEXTURE_2D, bitmapTextureFramebuffer.getTextureId(), 0);

    if (frame.yuvFrame) {
      listenerAndParams.drawer.drawYuv(yuvTextures, bitmapMatrix, frame.rotatedWidth(),
          frame.rotatedHeight(), 0 /* viewportX */, 0 /* viewportY */, scaledWidth, scaledHeight);
    } else {
      listenerAndParams.drawer.drawOes(frame.textureId, bitmapMatrix, frame.rotatedWidth(),
          frame.rotatedHeight(), 0 /* viewportX */, 0 /* viewportY */, scaledWidth, scaledHeight);
    }

    final ByteBuffer bitmapBuffer = ByteBuffer.allocateDirect(scaledWidth * scaledHeight * 4);
    GLES20.glViewport(0, 0, scaledWidth, scaledHeight);
    GLES20.glReadPixels(
        0, 0, scaledWidth, scaledHeight, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, bitmapBuffer);

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
    GlUtil.checkNoGLES2Error("EglRenderer.notifyCallbacks");

    final Bitmap bitmap = Bitmap.createBitmap(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);
    bitmap.copyPixelsFromBuffer(bitmapBuffer);
    listenerAndParams.listener.onFrame(bitmap);
  }
}
 
开发者ID:lgyjg,项目名称:AndroidRTC,代码行数:54,代码来源:EglRenderer.java

示例9: drawBlurPass

import android.opengl.GLES20; //导入方法依赖的package包/类
private boolean drawBlurPass() {
    if (showOriginal || blurType == 0) {
        return false;
    }
    if (needUpdateBlurTexture) {
        GLES20.glUseProgram(blurShaderProgram);
        GLES20.glUniform1i(blurSourceImageHandle, 0);
        GLES20.glEnableVertexAttribArray(blurInputTexCoordHandle);
        GLES20.glVertexAttribPointer(blurInputTexCoordHandle, 2, GLES20.GL_FLOAT, false, 8, textureBuffer);
        GLES20.glEnableVertexAttribArray(blurPositionHandle);
        GLES20.glVertexAttribPointer(blurPositionHandle, 2, GLES20.GL_FLOAT, false, 8, vertexInvertBuffer);

        GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, renderFrameBuffer[0]);
        GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, renderTexture[0], 0);
        GLES20.glClear(0);
        GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, renderTexture[1]);
        GLES20.glUniform1f(blurWidthHandle, 0.0f);
        GLES20.glUniform1f(blurHeightHandle, 1.0f / renderBufferHeight);
        GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);

        GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, renderFrameBuffer[2]);
        GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, renderTexture[2], 0);
        GLES20.glClear(0);
        GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, renderTexture[0]);
        GLES20.glUniform1f(blurWidthHandle, 1.0f / renderBufferWidth);
        GLES20.glUniform1f(blurHeightHandle, 0.0f);
        GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
        needUpdateBlurTexture = false;
    }

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, renderFrameBuffer[0]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, renderTexture[0], 0);
    GLES20.glClear(0);
    if (blurType == 1) {
        GLES20.glUseProgram(radialBlurShaderProgram);
        GLES20.glUniform1i(radialBlurSourceImageHandle, 0);
        GLES20.glUniform1i(radialBlurSourceImage2Handle, 1);
        GLES20.glUniform1f(radialBlurExcludeSizeHandle, blurExcludeSize);
        GLES20.glUniform1f(radialBlurExcludeBlurSizeHandle, blurExcludeBlurSize);
        GLES20.glUniform2f(radialBlurExcludePointHandle, blurExcludePoint.x, blurExcludePoint.y);
        GLES20.glUniform1f(radialBlurAspectRatioHandle, (float) renderBufferHeight / (float) renderBufferWidth);
        GLES20.glEnableVertexAttribArray(radialBlurInputTexCoordHandle);
        GLES20.glVertexAttribPointer(radialBlurInputTexCoordHandle, 2, GLES20.GL_FLOAT, false, 8, textureBuffer);
        GLES20.glEnableVertexAttribArray(radialBlurPositionHandle);
        GLES20.glVertexAttribPointer(radialBlurPositionHandle, 2, GLES20.GL_FLOAT, false, 8, vertexInvertBuffer);
    } else if (blurType == 2) {
        GLES20.glUseProgram(linearBlurShaderProgram);
        GLES20.glUniform1i(linearBlurSourceImageHandle, 0);
        GLES20.glUniform1i(linearBlurSourceImage2Handle, 1);
        GLES20.glUniform1f(linearBlurExcludeSizeHandle, blurExcludeSize);
        GLES20.glUniform1f(linearBlurExcludeBlurSizeHandle, blurExcludeBlurSize);
        GLES20.glUniform1f(linearBlurAngleHandle, blurAngle);
        GLES20.glUniform2f(linearBlurExcludePointHandle, blurExcludePoint.x, blurExcludePoint.y);
        GLES20.glUniform1f(linearBlurAspectRatioHandle, (float) renderBufferHeight / (float) renderBufferWidth);
        GLES20.glEnableVertexAttribArray(linearBlurInputTexCoordHandle);
        GLES20.glVertexAttribPointer(linearBlurInputTexCoordHandle, 2, GLES20.GL_FLOAT, false, 8, textureBuffer);
        GLES20.glEnableVertexAttribArray(linearBlurPositionHandle);
        GLES20.glVertexAttribPointer(linearBlurPositionHandle, 2, GLES20.GL_FLOAT, false, 8, vertexInvertBuffer);
    }

    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, renderTexture[1]);
    GLES20.glActiveTexture(GLES20.GL_TEXTURE1);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, renderTexture[2]);
    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);

    return true;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:71,代码来源:PhotoFilterView.java

示例10: attach

import android.opengl.GLES20; //导入方法依赖的package包/类
public void attach(int point, Texture tex) {
	bind();
	GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, point, GLES20.GL_TEXTURE_2D, tex.id, 0);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:5,代码来源:Framebuffer.java

示例11: attach

import android.opengl.GLES20; //导入方法依赖的package包/类
public void attach( int point, Texture tex ) {
	bind();
	GLES20.glFramebufferTexture2D( GLES20.GL_FRAMEBUFFER, point, GLES20.GL_TEXTURE_2D, tex.id, 0 );
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:5,代码来源:Framebuffer.java


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