Results 1 to 10 of 10

Thread: Weird glGetError 1286

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Weird glGetError 1286

    I get this error 1286 when running my nxPascal framebuffer demo. It works fine, i see textured cube with framebuffer effect. Although i'd like to get rid of the error if possible.
    GL_INVALID_FRAMEBUFFER_OPERATION = $0506; (1286 in dec)

    I traced the error down to my model (cube) rendering at glDrawElements. Then in this link:
    http://www.khronos.org/opengles/sdk/...awElements.xml
    GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE).
    And so i have checked that too before using glDrawElements with:
    Code:
    function TNXGL.CanRender: boolean;
    begin
      result:=glCheckFramebufferStatus(GL_FRAMEBUFFER)=GL_FRAMEBUFFER_COMPLETE;
    end;
    If checked CanRender at beginning of rendering loop, and if false, skip rest until window is ready to render, and it returned true.

    Starting to be out of ideas... I can simply comment out the ShowMessage(...error here...), but then i won't have peace of mind

  2. #2
    This error means that frame buffers were not created correctly. Check this link under "Framebuffer Completeness" section.

    In some cases the application may apparently work as expected as certain OpenGL drivers try really hard to maintain functionality (typically Nvidia video cards), but it doesn't mean that everything is okay. Try running the same application on AMD and Intel video cards to see how it works.

    If you could post the frame buffer's creation code, I'd take a look to see what's missing.

  3. #3
    I have Intel CPU and AMD video card Raden HD 5700.

    The files are all available there, from SVN trunk:
    http://code.google.com/p/nxpascal/so...%2Ftrunk%2Fsrc
    Or now already bit outdated zip files of source and demos.

    Window is created in nxGL.pas at line 606, and with fpc it uses TOpenGLContext, and functions from dglOpenGL. I get same error with Delphi 7 too though, which uses only dglOpenGL. (In both cases on a TForm)
    http://code.google.com/p/nxpascal/so...k/src/nxGL.pas

    Also, the demo is doing the glDrawElements() while compiling a displaylist only, so it shouldn't actually be doing anything to framebuffer.
    Last edited by User137; 04-08-2012 at 09:17 AM.

  4. #4
    Would you mind copying and posting FBO creation code here?

    Quote Originally Posted by User137 View Post
    Also, the demo is doing the glDrawElements() while compiling a displaylist only, so it shouldn't actually be doing anything to framebuffer.
    Are you rendering to the frame buffer? In other words, is frame buffer active while you call to glDrawElements? Because if not, errors could be propagating from FBO creation to rendering code.

    Also, I'd suggest putting glGetError() after each call in FBO creation to see if some portion is not being created properly. Finally, you might want to comment the FBO section entirely, if it's not being used anyway.

  5. #5
    I commented out nearly all code now. Only these are executed:
    Code:
    in formCreate:
      nx.CreateGlWindow(self);
    
    in onTimer:
      if cube=nil then begin
        // Do glCheckFramebufferStatus
        if not nx.CanRender then exit;
    
        err:=glGetError();
        if err>0 then ShowMessage(format('Model_before: glGetError, code: %d',[err]));
    
        model:=TGLModel.Create;
        model.LoadFromW3D('cube.w3d');
        model.UseMaterials:=false;
        model.MakeDisplayList(cube);
        model.Free;
    
        err:=glGetError();
        if err>0 then ShowMessage(format('Model_after: glGetError, code: %d',[err]));
        // Seen code 1286 (GL_INVALID_FRAMEBUFFER_OPERATION)
    
        exit;
      end;
    I get only 1 messagedialog with "Model_after...1286".

    So FBO is not being used at all, just rendering vertex array to displaylist. If i comment out "model.MakeDisplayList(cube);", then no error comes.

    I also made a guide in the nxPascal wiki to show how to easily install the SVN version. It shouldn't take more than 1 minute if you already have SVN environment in your system, something like TortoiseSVN, or linux comparative. This whole demo is included there.

  6. #6
    It seems that you'll have to narrow the issue down within MakeDisplayList() itself. Try commenting lines one by one after which the error code disappears.

    Other than that, the code is a bit difficult to understand. By the way, an unrelated note is that you may want to make plans to switch away from deprecated functionality such as display lists, which only make code more complicated, and client states (e.g. glEnableClientState/glDisableClientState calls).

    Quote Originally Posted by User137 View Post
    I also made a guide in the nxPascal wiki to show how to easily install the SVN version. It shouldn't take more than 1 minute if you already have SVN environment in your system, something like TortoiseSVN, or linux comparative. This whole demo is included there.
    It's not about installing SVN and updating from the trunk, but all that takes time, which means more time for doing unnecessary work and less time to analyze the code and help you. We're working 10 hours a day including weekends lately so free time is a luxury.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •