Results 1 to 2 of 2

Thread: OpenGL rendering to framebufferobject

  1. #1
    Join Date
    Sep 2013
    Posts
    9
    Thanked 1 Time in 1 Post

    Default 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.

    Qt Code:
    1. void LogoRenderer::render()
    2. {
    3. glClearColor(0.0f, 0.5f, 0.7f, 1.0f);
    4. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    5.  
    6. glColor3f(1.0, 0.0, 0.0);
    7. glPointSize(10.0f);
    8. glBegin(GL_POINTS);
    9. glVertex2i(0, 0);
    10. glEnd();
    11. }
    To copy to clipboard, switch view to plain text mode 

    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

  2. #2
    Join Date
    Nov 2014
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: OpenGL rendering to framebufferobject

    Hi,

    I'm having exactly the same problem here.
    I wrote a subclass of QQuickFramebufferObject, and a renderer.
    The first rendering (after application start) get displayed correctly, every updater afterwards doesn't show anything than the backgroundcolor of my glClear().
    It might have something to do with GL_DEPTH_TEST or some clipping?

    Does anybody has some hint?
    I'm trying around for 2 days now and I'm going nuts!

    CU
    mts

Similar Threads

  1. Conversion from opengl to opengl es2 (Shapefile rendering)?
    By swapan_gh in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 5th December 2013, 06:59
  2. Problem rendering using OpenGL in VM
    By xtal256 in forum Qt Programming
    Replies: 4
    Last Post: 2nd November 2011, 01:10
  3. OpenGL rendering of Qt widgets
    By Luc4 in forum Qt Programming
    Replies: 0
    Last Post: 31st July 2011, 22:35
  4. OpenGL rendering and threads
    By brcain in forum Qt Programming
    Replies: 2
    Last Post: 3rd July 2008, 09:45
  5. OpenGL rendering problem
    By spud in forum Qt Programming
    Replies: 5
    Last Post: 27th February 2007, 19:44

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
  •  
Qt is a trademark of The Qt Company.