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


Java FrameBuffer.getNumColorBuffers方法代码示例

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


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

示例1: updateFrameBuffer

import com.jme3.texture.FrameBuffer; //导入方法依赖的package包/类
public void updateFrameBuffer(FrameBuffer fb) {
    int id = fb.getId();
    if (id == -1) {
        // create FBO
        glGenFramebuffersEXT(intBuf1);
        id = intBuf1.get(0);
        fb.setId(id);
        objManager.registerForCleanup(fb);

        statistics.onNewFrameBuffer();
    }

    if (context.boundFBO != id) {
        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, id);
        // binding an FBO automatically sets draw buf to GL_COLOR_ATTACHMENT0
        context.boundDrawBuf = 0;
        context.boundFBO = id;
    }

    FrameBuffer.RenderBuffer depthBuf = fb.getDepthBuffer();
    if (depthBuf != null) {
        updateFrameBufferAttachment(fb, depthBuf);
    }

    for (int i = 0; i < fb.getNumColorBuffers(); i++) {
        FrameBuffer.RenderBuffer colorBuf = fb.getColorBuffer(i);
        updateFrameBufferAttachment(fb, colorBuf);
    }

    fb.clearUpdateNeeded();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:32,代码来源:LwjglRenderer.java

示例2: printRealFrameBufferInfo

import com.jme3.texture.FrameBuffer; //导入方法依赖的package包/类
private void printRealFrameBufferInfo(FrameBuffer fb) {
//        boolean doubleBuffer = GLES20.glGetBooleanv(GLES20.GL_DOUBLEBUFFER);
        boolean doubleBuffer = false; // FIXME
//        String drawBuf = getTargetBufferName(glGetInteger(GL_DRAW_BUFFER));
//        String readBuf = getTargetBufferName(glGetInteger(GL_READ_BUFFER));

        int fbId = fb.getId();
        intBuf16.clear();
//        int curDrawBinding = GLES20.glGetIntegerv(GLES20.GL_DRAW_FRAMEBUFFER_BINDING);
//        int curReadBinding = glGetInteger(ARBFramebufferObject.GL_READ_FRAMEBUFFER_BINDING);

        System.out.println("=== OpenGL FBO State ===");
        System.out.println("Context doublebuffered? " + doubleBuffer);
        System.out.println("FBO ID: " + fbId);
        System.out.println("Is proper? " + Gdx.gl20.glIsFramebuffer(fbId));
//        System.out.println("Is bound to draw? " + (fbId == curDrawBinding));
//        System.out.println("Is bound to read? " + (fbId == curReadBinding));
//        System.out.println("Draw buffer: " + drawBuf);
//        System.out.println("Read buffer: " + readBuf);

        if (context.boundFBO != fbId) {
            Gdx.gl20.glBindFramebuffer(GL20.GL_FRAMEBUFFER, fbId);
            context.boundFBO = fbId;
        }

        if (fb.getDepthBuffer() != null) {
            printRealRenderBufferInfo(fb, fb.getDepthBuffer(), "Depth");
        }
        for (int i = 0; i < fb.getNumColorBuffers(); i++) {
            printRealRenderBufferInfo(fb, fb.getColorBuffer(i), "Color" + i);
        }
    }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:33,代码来源:GdxRenderer.java

示例3: updateFrameBuffer

import com.jme3.texture.FrameBuffer; //导入方法依赖的package包/类
public void updateFrameBuffer(FrameBuffer fb) {
        int id = fb.getId();
        if (id == -1) {
            intBuf1.clear();
            // create FBO
            Gdx.gl20.glGenFramebuffers(1, intBuf1);
//            RendererUtil.checkGLError();

            id = intBuf1.get(0);
            fb.setId(id);
            objManager.registerForCleanup(fb);

            statistics.onNewFrameBuffer();
        }

        if (context.boundFBO != id) {
            Gdx.gl20.glBindFramebuffer(GL20.GL_FRAMEBUFFER, id);
//            RendererUtil.checkGLError();

            // binding an FBO automatically sets draw buf to GL_COLOR_ATTACHMENT0
            context.boundDrawBuf = 0;
            context.boundFBO = id;
        }

        RenderBuffer depthBuf = fb.getDepthBuffer();
        if (depthBuf != null) {
            updateFrameBufferAttachment(fb, depthBuf);
        }

        for (int i = 0; i < fb.getNumColorBuffers(); i++) {
            RenderBuffer colorBuf = fb.getColorBuffer(i);
            updateFrameBufferAttachment(fb, colorBuf);
        }

        fb.clearUpdateNeeded();
    }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:37,代码来源:GdxRenderer.java

示例4: printRealFrameBufferInfo

import com.jme3.texture.FrameBuffer; //导入方法依赖的package包/类
private void printRealFrameBufferInfo(FrameBuffer fb) {
//        boolean doubleBuffer = GLES20.glGetBooleanv(GLES20.GL_DOUBLEBUFFER);
        boolean doubleBuffer = false; // FIXME
//        String drawBuf = getTargetBufferName(glGetInteger(GL_DRAW_BUFFER));
//        String readBuf = getTargetBufferName(glGetInteger(GL_READ_BUFFER));

        int fbId = fb.getId();
        intBuf16.clear();
//        int curDrawBinding = GLES20.glGetIntegerv(GLES20.GL_DRAW_FRAMEBUFFER_BINDING);
//        int curReadBinding = glGetInteger(ARBFramebufferObject.GL_READ_FRAMEBUFFER_BINDING);

        System.out.println("=== OpenGL FBO State ===");
        System.out.println("Context doublebuffered? " + doubleBuffer);
        System.out.println("FBO ID: " + fbId);
        System.out.println("Is proper? " + GLES20.glIsFramebuffer(fbId));
//        System.out.println("Is bound to draw? " + (fbId == curDrawBinding));
//        System.out.println("Is bound to read? " + (fbId == curReadBinding));
//        System.out.println("Draw buffer: " + drawBuf);
//        System.out.println("Read buffer: " + readBuf);

        if (context.boundFBO != fbId) {
            GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, fbId);
            context.boundFBO = fbId;
        }

        if (fb.getDepthBuffer() != null) {
            printRealRenderBufferInfo(fb, fb.getDepthBuffer(), "Depth");
        }
        for (int i = 0; i < fb.getNumColorBuffers(); i++) {
            printRealRenderBufferInfo(fb, fb.getColorBuffer(i), "Color" + i);
        }
    }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:33,代码来源:OGLESShaderRenderer.java

示例5: updateFrameBuffer

import com.jme3.texture.FrameBuffer; //导入方法依赖的package包/类
public void updateFrameBuffer(FrameBuffer fb) {
        int id = fb.getId();
        if (id == -1) {
            intBuf1.clear();
            // create FBO
            GLES20.glGenFramebuffers(1, intBuf1);
//            RendererUtil.checkGLError();

            id = intBuf1.get(0);
            fb.setId(id);
            objManager.registerForCleanup(fb);

            statistics.onNewFrameBuffer();
        }

        if (context.boundFBO != id) {
            GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, id);
//            RendererUtil.checkGLError();

            // binding an FBO automatically sets draw buf to GL_COLOR_ATTACHMENT0
            context.boundDrawBuf = 0;
            context.boundFBO = id;
        }

        FrameBuffer.RenderBuffer depthBuf = fb.getDepthBuffer();
        if (depthBuf != null) {
            updateFrameBufferAttachment(fb, depthBuf);
        }

        for (int i = 0; i < fb.getNumColorBuffers(); i++) {
            FrameBuffer.RenderBuffer colorBuf = fb.getColorBuffer(i);
            updateFrameBufferAttachment(fb, colorBuf);
        }

        fb.clearUpdateNeeded();
    }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:37,代码来源:OGLESShaderRenderer.java

示例6: updateFrameBuffer

import com.jme3.texture.FrameBuffer; //导入方法依赖的package包/类
public void updateFrameBuffer(FrameBuffer fb) {
    int id = fb.getId();
    if (id == -1) {
        // create FBO
        id = genFramebufferId();
        fb.setId(id);
        objManager.registerForCleanup(fb);

        statistics.onNewFrameBuffer();
    }

    if (context.boundFBO != id) {
        bindFramebuffer(id);
        // binding an FBO automatically sets draw buf to GL_COLOR_ATTACHMENT0
        context.boundDrawBuf = 0;
        context.boundFBO = id;
    }

    FrameBuffer.RenderBuffer depthBuf = fb.getDepthBuffer();
    if (depthBuf != null) {
        updateFrameBufferAttachment(fb, depthBuf);
    }

    for (int i = 0; i < fb.getNumColorBuffers(); i++) {
        FrameBuffer.RenderBuffer colorBuf = fb.getColorBuffer(i);
        updateFrameBufferAttachment(fb, colorBuf);
    }

    fb.clearUpdateNeeded();
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:31,代码来源:AbstractRenderer.java

示例7: printRealFrameBufferInfo

import com.jme3.texture.FrameBuffer; //导入方法依赖的package包/类
private void printRealFrameBufferInfo(FrameBuffer fb) {
    boolean doubleBuffer = glGetBoolean(GL_DOUBLEBUFFER);
    String drawBuf = getTargetBufferName(glGetInteger(GL_DRAW_BUFFER));
    String readBuf = getTargetBufferName(glGetInteger(GL_READ_BUFFER));
    
    int fbId = fb.getId();
    int curDrawBinding = glGetInteger(ARBFramebufferObject.GL_DRAW_FRAMEBUFFER_BINDING);
    int curReadBinding = glGetInteger(ARBFramebufferObject.GL_READ_FRAMEBUFFER_BINDING);

    System.out.println("=== OpenGL FBO State ===");
    System.out.println("Context doublebuffered? " + doubleBuffer);
    System.out.println("FBO ID: " + fbId);
    System.out.println("Is proper? " + glIsFramebufferEXT(fbId));
    System.out.println("Is bound to draw? " + (fbId == curDrawBinding));
    System.out.println("Is bound to read? " + (fbId == curReadBinding));
    System.out.println("Draw buffer: " + drawBuf);
    System.out.println("Read buffer: " + readBuf);
    
    if (context.boundFBO != fbId){
        glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbId);
        context.boundFBO = fbId;
    }
    
    if (fb.getDepthBuffer() != null){
        printRealRenderBufferInfo(fb, fb.getDepthBuffer(), "Depth");
    }
    for (int i = 0; i < fb.getNumColorBuffers(); i++){
        printRealRenderBufferInfo(fb, fb.getColorBuffer(i), "Color" + i);
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:31,代码来源:LwjglRenderer.java


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