OpenGL rendering to framebufferobject



  • Hi,

    I'm trying to port some old renderer to be used in a small qml application. For that I'm using the TexturesInSGNode example (examples->quick->scenegraph->texturesinsgnode). I changed the logorenderer (under the shared folder) for that to just a very basic test. I removed everything from the initialize function (the renderer does not use shaders, just some simple glBegin-glEnd drawing) and the render function looks like this.

    @
    void LogoRenderer::render()
    {
    glClearColor(0.0f, 0.5f, 0.7f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glColor3f(1.0, 0.0, 0.0);
    glPointSize(10.0f);
    glBegin(GL_POINTS);
    glVertex2i(0, 0);
    glEnd();
    }
    @

    When I render this, only the first frame is rendered correct (a red dot in the center of the qml component, but all frames after that are not rendered correct (nothing shown, just the clearcolor) (also it seems the Y-axis is flipped, but as I understand, this is normal).
    When I comment the update() function in the QQuickFramebufferObject::Renderer render() function (in this render function before the update() function, the above logorenderer::render() function is called), the red dot is rendered correct, but the logorender::render() function is called only once, when i uncomment that update function, the logorender::render() function is called every frame, but then only the clearcolor is shown without the red dot. I'm sure I'm missing something very stupid, but I don't know what...
    Regards,

    Matt



  • Hmm missing the bind? Is a sample from "this":http://qt-project.org/forums/viewthread/47767/ thread.
    @
    this->_fbo->bind();
    glClear(GL_COLOR_BUFFER_BIT);
    this->_fbo->release();
    @



  • Don't think so. I don't really have access to the framebufferobject. According to the documentation, you should just implement the render function (and synchronize function if necessary). But according to "this":http://qt-project.org/forums/viewthread/45889 thread, I'm not the only one with that problem, so I've decided to switch to use shaders anyway.

    Matt



  • Hey guys,

    I'm having the same problem here.
    Is there any solution?

    CU
    mts


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.