for (int i = 0; i < fb.getNumColorBuffers(); i++){ if (!supportsColorBuffer(caps, fb.getColorBuffer(i))){ return false;
if (fb.getNumColorBuffers() == 0) { if (fb.getNumColorBuffers() > limits.get(Limits.FrameBufferAttachments)) { throw new RendererException("Framebuffer has more color " + "attachments than are supported" + " are not supported by the video hardware"); if (fb.getNumColorBuffers() > limits.get(Limits.FrameBufferMrtAttachments)) { throw new RendererException("Framebuffer has more" + " multi targets than are supported" for (int i = 0; i < fb.getNumColorBuffers(); i++) { intBuf16.put(GLFbo.GL_COLOR_ATTACHMENT0_EXT + i); context.boundDrawBuf = MRT_OFF + fb.getNumColorBuffers();
public void updateFrameBuffer(FrameBuffer fb) { if (fb.getNumColorBuffers() == 0 && fb.getDepthBuffer() == null) { throw new IllegalArgumentException("The framebuffer: " + fb + "\nDoesn't have any color/depth buffers"); } int id = fb.getId(); if (id == -1) { glfbo.glGenFramebuffersEXT(intBuf1); id = intBuf1.get(0); fb.setId(id); objManager.registerObject(fb); statistics.onNewFrameBuffer(); } bindFrameBuffer(fb); 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); } setReadDrawBuffers(fb); checkFrameBufferError(); fb.clearUpdateNeeded(); }
for (int i = 0; i < context.boundFB.getNumColorBuffers(); i++) { RenderBuffer rb = context.boundFB.getColorBuffer(i); Texture tex = rb.getTexture();
for (int i = 0; i < fb.getNumColorBuffers(); i++){ if (!supportsColorBuffer(caps, fb.getColorBuffer(i))){ return false;
if (fb.getNumColorBuffers() == 0) { if (fb.getNumColorBuffers() > limits.get(Limits.FrameBufferAttachments)) { throw new RendererException("Framebuffer has more color " + "attachments than are supported" + " are not supported by the video hardware"); if (fb.getNumColorBuffers() > limits.get(Limits.FrameBufferMrtAttachments)) { throw new RendererException("Framebuffer has more" + " multi targets than are supported" for (int i = 0; i < fb.getNumColorBuffers(); i++) { intBuf16.put(GLFbo.GL_COLOR_ATTACHMENT0_EXT + i); context.boundDrawBuf = MRT_OFF + fb.getNumColorBuffers();
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(GL_DRAW_FRAMEBUFFER_BINDING_EXT); int curReadBinding = glGetInteger(GL_READ_FRAMEBUFFER_BINDING_EXT); 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); } }
public void updateFrameBuffer(FrameBuffer fb) { if (fb.getNumColorBuffers() == 0 && fb.getDepthBuffer() == null) { throw new IllegalArgumentException("The framebuffer: " + fb + "\nDoesn't have any color/depth buffers"); } int id = fb.getId(); if (id == -1) { glfbo.glGenFramebuffersEXT(intBuf1); id = intBuf1.get(0); fb.setId(id); objManager.registerObject(fb); statistics.onNewFrameBuffer(); } bindFrameBuffer(fb); 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); } setReadDrawBuffers(fb); checkFrameBufferError(); fb.clearUpdateNeeded(); }
public void updateFrameBuffer(FrameBuffer fb) { int id = fb.getId(); if (id == -1) { // create FBO glGenFramebuffersEXT(intBuf1); id = intBuf1.get(0); fb.setId(id); objManager.registerObject(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(); }
for (int i = 0; i < context.boundFB.getNumColorBuffers(); i++) { RenderBuffer rb = context.boundFB.getColorBuffer(i); Texture tex = rb.getTexture(); if (fb.getNumColorBuffers() == 0 && fb.getDepthBuffer() == null) { throw new IllegalArgumentException("The framebuffer: " + fb + "\nDoesn't have any color/depth buffers"); statistics.onFrameBufferUse(fb, false); if (fb.getNumColorBuffers() == 0) { if (fb.getNumColorBuffers() > maxFBOAttachs) { throw new RendererException("Framebuffer has more color " + "attachments than are supported" if (fb.getNumColorBuffers() > maxMRTFBOAttachs) { throw new RendererException("Framebuffer has more" + " multi targets than are supported" if (context.boundDrawBuf != 100 + fb.getNumColorBuffers()) { intBuf16.clear(); for (int i = 0; i < fb.getNumColorBuffers(); i++) { intBuf16.put(GL_COLOR_ATTACHMENT0_EXT + i); context.boundDrawBuf = 100 + fb.getNumColorBuffers();
for (int i = 0; i < context.boundFB.getNumColorBuffers(); i++) { RenderBuffer rb = context.boundFB.getColorBuffer(i); Texture tex = rb.getTexture();