Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. OpenGL rendering to framebufferobject
Forum Updated to NodeBB v4.3 + New Features

OpenGL rendering to framebufferobject

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MattieB
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dasRicardo
      wrote on last edited by
      #2

      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();
      @

      **Sorry for my english :)

      PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MattieB
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • T Offline
          T Offline
          themts
          wrote on last edited by
          #4

          Hey guys,

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

          CU
          mts

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved