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. Using existing OpenGL texture in QQuickFramebufferObject
Forum Updated to NodeBB v4.3 + New Features

Using existing OpenGL texture in QQuickFramebufferObject

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 215 Views
  • 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.
  • A Offline
    A Offline
    adazem009
    wrote on last edited by
    #1

    I have some custom OpenGL textures and I want to use them in QQuickFramebufferObject items. All I need is to replace the Qt-created texture by my own, probably by attaching it to the framebuffer object. Here's what I'm currently doing in the render() method:

    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, my_texture_id, 0);
    framebufferObject()->toImage().save("/path/to/image.png");
    

    I test the FBO by saving it in an image and it correctly saves my texture. However, nothing is displayed on the screen.

    Is it possible to make the renderer use my texture instead of the one created by QOpenGLFramebuffer object?

    I want to avoid creating another FBO with my texture and then blitting it to the Qt Quick FBO because I think that's more expensive (correct me in this if I'm wrong).

    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