com.jme3.texture.FrameBuffer.getNumColorBuffers()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(69)

本文整理了Java中com.jme3.texture.FrameBuffer.getNumColorBuffers()方法的一些代码示例,展示了FrameBuffer.getNumColorBuffers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FrameBuffer.getNumColorBuffers()方法的具体详情如下:
包路径:com.jme3.texture.FrameBuffer
类名称:FrameBuffer
方法名:getNumColorBuffers

FrameBuffer.getNumColorBuffers介绍

暂无

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

for (int i = 0; i < fb.getNumColorBuffers(); i++){
  if (!supportsColorBuffer(caps, fb.getColorBuffer(i))){
    return false;

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

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();

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

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();
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

for (int i = 0; i < context.boundFB.getNumColorBuffers(); i++) {
  RenderBuffer rb = context.boundFB.getColorBuffer(i);
  Texture tex = rb.getTexture();

代码示例来源:origin: org.jmonkeyengine/jme3-core

for (int i = 0; i < fb.getNumColorBuffers(); i++){
  if (!supportsColorBuffer(caps, fb.getColorBuffer(i))){
    return false;

代码示例来源:origin: org.jmonkeyengine/jme3-core

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();

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl

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);
  }
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

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();
}

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl

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();
}

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl

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();

代码示例来源:origin: org.jmonkeyengine/jme3-core

for (int i = 0; i < context.boundFB.getNumColorBuffers(); i++) {
  RenderBuffer rb = context.boundFB.getColorBuffer(i);
  Texture tex = rb.getTexture();

相关文章