Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 21

Thread: Render to texture using FBO on ATI Radeon 9550

Hybrid View

  1. #1
    Advanced Member Frequent Contributor
    Join Date
    Dec 2005
    Location
    Italy
    Posts
    655

    Render to texture using FBO on ATI Radeon 9550

    Hi All,


    Now I have a perfect working FBO based render to texture (on the developing machine) but can't see it working on the ATI Radeon 9550 / X1050 mentioned in the subject of this post. Of course all the necessary extensions are present on the second machine and OpenGL version is 2.1.7873.

    I attach the code to see if somebody discover something that can be improved.

    I wanted also to ask:

    1) if I can expect a bug/missing functionality on the driver for this trivial FBO implementation
    2) if there is a tool to analyze FBOs


    Thanks,

    Alberto

    Code :
    glBindTexture(GL_TEXTURE_2D, textureName);            
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, textureSize, textureSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, null);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     
    fbo = glGenFramebuffersEXT();
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
    glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, textureName, 0);
     
    // Checks FBO status
    int status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
    ReportFboStatus(status);
     
    // Draws on texture
    DrawShadow();

  2. #2
    Senior Member OpenGL Pro sqrt[-1]'s Avatar
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    1,000

    Re: Render to texture using FBO on ATI Radeon 9550

    I keep saying this to almost everyone that comes here (see previous posts)

    ENSURE, that you specify the third parameter of glTexImage2D as a known type, otherwise the driver will pick a format for you. (On ATI - it has a habit of choosing a 16bit texture format - which is probably not a good render target)

    So change your code to:
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, textureSize, textureSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, null);

    If that does not work, I don't know what is wrong...

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Dec 2005
    Location
    Italy
    Posts
    655

    Re: Render to texture using FBO on ATI Radeon 9550

    sqrt[-1],


    Unfortunately it does not help.

    I was wondering if the choice to use:

    gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);

    and not generating mipmaps can someway be a "non-standard" approach because the result is exacly like the one we obtained when forgot to use the gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR) call.

    Thanks,

    Alberto

  4. #4
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,264

    Re: Render to texture using FBO on ATI Radeon 9550

    This is not standard
    fbo = glGenFramebuffersEXT();

    It should be
    glGenFramebuffersEXT(1, &fb);

    Just try the example from which will work on every driver and GPU
    http://www.opengl.org/wiki/index.php...ebuffer_object
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Dec 2005
    Location
    Italy
    Posts
    655

    Re: Render to texture using FBO on ATI Radeon 9550

    Yes V-man,

    It simply calls the following:

    Code :
    public static uint GenFramebuffersEXT()
    {
       uint[] result = new uint[1];
       glGenFramebuffersEXT(1, result);
       return result[0];
    }

    Thanks,

    Alberto

  6. #6
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,290

    Re: Render to texture using FBO on ATI Radeon 9550

    This is one of the many reasons I abandoned that generation of ATi cards. RTT on R9600 never worked (be it opengl or dx9c), shaders were reported to be version 2.0a but even 2.0 did not work without crashes

Posting Permissions

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