[Interest] Qt3D Multiple color targets not working

Gil H qt at tastytech.ca
Wed Aug 7 15:45:51 CEST 2019

Thanks Sean.  I had that framegraph set up, but I was trying to use a single RenderTarget with multiple textures attached for all the rendering, instead of what ended up working more easily, which was to simply create a separate RenderTarget for each sub-graph and just attach the textures to color0.  



From: Interest <interest-bounces at qt-project.org> on behalf of Sean Harmer <sh at theharmers.co.uk>
Date: Wednesday, August 7, 2019 at 4:40 AM
To: Qt Interest <interest at qt-project.org>
Subject: Re: [Interest] Qt3D Multiple color targets not working


Hi Gil,

With an FBO with multiple textures attached each texture will still have the same pixels rasterised. You can't draw different cameras and scenes into each texture at the same time. Well something like that can be done with some advanced use of the geometry shader but I don't think that's the case here.

If you want to draw 3 different scenes into 3 different textures you will need 3 different sub-trees in your framegraph. Each one will set the camera to use, the filters to select the subset of the scene graph to draw and the FBO with the target texture to render into.



On 01/08/2019 18:42, Gil H wrote:

Hello everyone, I’m sure I’m doing something wrong here, but basically, I’m trying to render multiple frame graph subtrees into multiple texture targets, and then draw those as part of the final scene (kind of like seeing security camera feeds on a few textured quads).  Attached is my minimal test app which shows that only textures attached to Color0 seem to contain anything.  Is it because the surface is a QWindow?  I’ve tried a more complicated example with an offscreen render surface and an FBO with multiple color attachments added to it, but the textures I got back from that were still empty.


Tested this on Mac with Qt 5.13.0.


If anyone is curious about why you would want to do this, I need to render up to 3 different Qt3D scenes for integration into an external GL engine.  So different camera views and scene sub-trees need to be drawn onto separate textures each frame.





Interest mailing list
Interest at qt-project.org
_______________________________________________ Interest mailing list Interest at qt-project.org https://lists.qt-project.org/listinfo/interest 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190807/88cd88cd/attachment.html>

More information about the Interest mailing list