Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: OpenGL 3.0 and writing to an integer framebuffer

  1. #11
    Member Regular Contributor
    Join Date
    Aug 2003
    Posts
    264

    Re: OpenGL 3.0 and writing to an integer framebuffer

    The error code is 1280, but the string returned by glewGetErrorString returns "Unknown Error".

  2. #12
    Junior Member Regular Contributor LangFox's Avatar
    Join Date
    Oct 2001
    Location
    Shen Zhen, Guangdong, China
    Posts
    103

    Re: OpenGL 3.0 and writing to an integer framebuffer

    Try using DrawBuffers enum value instead of 0?
    Best Regards,
    LangFox


    http://hi.baidu.com/lang_fox

  3. #13
    Member Regular Contributor
    Join Date
    Aug 2003
    Posts
    264

    Re: OpenGL 3.0 and writing to an integer framebuff

    Well I take back the error. That 1280 was being caused by my call to glDisable(GL_CLAMP_FRAGMENT_COLOR), b/c I thought that's how it was suppose to be called.

    I commented it out and now no errors are reported. Yet my texture remains black.

    But I did try what you said with using DrawBuffers, but a 1281 error is reported immediately after. I've tried the following:

    glBindFragDataLocation(program, GL_DRAW_BUFFER, "myIntOutput");
    glBindFragDataLocation(program, GL_DRAW_BUFFER0, "myIntOutput");

    Well I changed my texture format from GL_ALPHAUI32_EXT to GL_RGBAUI32_EXT and my texture is filled with the correct integer RGBA values. But I really need this to work for a single channel texture.

    Any suggestions? And thanks to everybody for all your help so far.

  4. #14
    Member Regular Contributor
    Join Date
    Aug 2003
    Posts
    264

    Re: OpenGL 3.0 and writing to an integer framebuff

    Well I discovered using GL_LUMINANCE32UI_EXT instead of GL_ALPHA32UI_EXT worked. Thanks again for everybody's help!

  5. #15
    Junior Member Regular Contributor LangFox's Avatar
    Join Date
    Oct 2001
    Location
    Shen Zhen, Guangdong, China
    Posts
    103

    Re: OpenGL 3.0 and writing to an integer framebuff

    Maybe R32UI is better than LUMINANCE32UI for forward compatibility.
    Best Regards,
    LangFox


    http://hi.baidu.com/lang_fox

  6. #16
    Junior Member Regular Contributor
    Join Date
    Mar 2007
    Location
    Latvia
    Posts
    225

    Re: OpenGL 3.0 and writing to an integer framebuffer

    Quote Originally Posted by Jan
    Isn't gl_ModelViewProjectionMatrix supposed to be deprecated in glsl 1.3? Or only the matrix stacks ?
    It is deprecated only in forward compatbile context. In full 3.0 context you can use whatever you want - even fixed functionality rendering.

    0 ir valid argument for colorNumber for glBindFragDataLocation function. It means it will write to 0 attachment of FBO. If it would expect enum there then function signature would include GLenum type, not uint.

  7. #17
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,171

    Re: OpenGL 3.0 and writing to an integer framebuffer

    Hang on... for integer textures you need to change your texture parameters according to the spec EXT_TEXTURE_INTEGER

    void TexParameterIivEXT( enum target, enum pname, int *params );
    void TexParameterIuivEXT( enum target, enum pname, uint *params );

    You are setting up the textures with plain old normalised glTexParameteri.

    Secondly, what makes you think EXT_FBO actually supports integer textures. I have checked ARB_FBO and that definately does..but reading the EXT_Integer_Texture I'm not so sure that it applies to EXT_FBO.

  8. #18
    Junior Member Regular Contributor
    Join Date
    Mar 2007
    Location
    Latvia
    Posts
    225

    Re: OpenGL 3.0 and writing to an integer framebuffer

    TexParameterIivEXT and TexParameterIuivEXT are needed only for GL_TEXTURE_BORDER_COLOR pname to specify color with integer values.

  9. #19
    Junior Member Newbie
    Join Date
    Dec 2009
    Posts
    1

    Re: OpenGL 3.0 and writing to an integer framebuffer

    I encountered the same problem in my program, the difference is that I used cg shader:

    glTexImage1D(GL_TEXTURE_1D, 0, GL_ALPHA8UI_EXT,8, 0, GL_ALPHA_INTEGER_EXT, GL_UNSIGNED_BYTE, sBitflag);

    param = cgGetNamedParameter(program, par);
    cgGLSetTextureParameter(param, tex);
    cgGLEnableTextureParameter(param);

    how to solve this problem?

Posting Permissions

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