10 Replies Latest reply on Nov 17, 2010 6:55 PM by pedela

    Bug: glBlitFramebuffer interpolation

    pedela

      When blitting from a renderbuffer to the screen, linear filtering does not work even if I set it to GL_LINEAR. I confirmed this using an NVIDIA 260 where I saw a difference between GL_NEAREST and GL_LINEAR. NVIDIA GL_NEAREST = ATI GL_LINEAR.

      • Linux 32-bit
      • Xorg 7.5
      • fglrx 10.5
      • OpenGL 3.2 compat context
      • ATI HD 4870, 5670

      int width = 1280;
      int height = 720;
      int xWidth = XDisplayWidth(xDisplay, xWindow) - 1;
      int xHeight = XDisplayHeight(xDisplay, xWindow) - 1;
      GLuint fboId, rboIds[2];

      glGenRenderbuffers(2, rboIds);
      glBindRenderbuffer(GL_RENDERBUFFER, rboIds[0]);
      glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA, width, height);

      glBindRenderbuffer(GL_RENDERBUFFER, rboIds[1]);
      glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_STENCIL, width, height);

      glBindRenderbuffer(GL_RENDERBUFFER, 0);

      glGenFramebuffers(1, &fboId);
      glBindFramebuffer(GL_FRAMEBUFFER, fboId);
      glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rboIds[0]);
      glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rboIds[1]);

      glClearColor(1, 0, 0, 1);
      glViewport(0, 0, width, height);

      while (1) {
      glBindFramebuffer(GL_FRAMEBUFFER, fboId);
      glClear(GL_COLOR_BUFFER_BIT);
      glBindFramebuffer(GL_READ_FRAMEBUFFER, fboId);
      glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
      glBlitFramebuffer(0, 0, width, height, 0, 0, xWidth, xHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
      glXSwapBuffers(xDisplay, xWindow);

      }

       

      EDIT: How do I put the code into a nice box? The forum help is not very helpful.