Ogre-next Version: 3.0
Operating System: Ubuntu20.04
Render System: GL3Plus
I am currently updating an older project to ogre-next from ogre where we use libmpv which takes a URL video stream and render it to an ogre Opengl texture using the textures fboid.
Previously we could do something like this to get the fboid, which we then used with libmpv mpv_opengl_fbo to let libmpv render to that texture.
Code: Select all
uint32_t id;
auto target = texture->getBuffer()->getRenderTarget();
target->getCustomAttribute("GL_FBOID", &id);
But this does not work anymore. I currently only need it to work with GL3Plus as the render system.
I have tried a couple of things. Getting the texture id with
Code: Select all
texture->getCustomAttribute(Ogre::TextureGpu::msFinalTextureBuffer, &textureID);
And then manual creating my own frame buffer
Code: Select all
glGenFramebuffers(1, &m_fbo);
then temporarily binding my texture to that frame buffer with
Code: Select all
glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureID, 0);
and letting libmpv render to m_fbo.
But the texture does not get rendered to. I do not get any error or warnings while I do this. I have also tried using the frame buffers from GL3PlusTextureGpuManager, but when I try to use them I get included problems with gl3w.
This is how the texture get created.
Code: Select all
m_texture = textureGPUManager->createOrRetrieveTexture(textureName,
Ogre::GpuPageOutStrategy::Discard,
Ogre::TextureFlags::RenderToTexture,
Ogre::TextureTypes::Type2D);
m_texture->setResolution(getWidth(), getHeight());
m_texture->setPixelFormat(Ogre::PFG_RGBA8_UNORM);
m_texture->scheduleTransitionTo(Ogre::GpuResidency::Resident);
m_texture->waitForData();
Any help on how to go about this would be appreciated.