Scratch that, forgot to set the item size to fill the window.  Changing that 
fixes it in the standalone example.

 

 

From: Interest <interest-boun...@qt-project.org> on behalf of Gil H 
<q...@tastytech.ca>
Date: Thursday, August 8, 2019 at 11:18 AM
To: Qt Interest <interest@qt-project.org>
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

Hi guys, I got it working using Qt3DQuickWindow, but when I tried to integrate 
the same framegraph in my actual implementation (offscreen rendering to FBO 
similar to Scene3D’s code) the texture handles come back as 0.  

 

Attached is my standalone example, modified to use Scene3D to illustrate the 
problem.  It fails to render properly and prints errors about incomplete 
framebuffers.  If you uncomment the other code block in main.cpp, with a 
Qt3DQuickWindow it all works fine.  My use case involves taking each rendered 
texture and drawing it as part of an external custom GL engine.  So, I need 
Qt3D to render multiple textures of different views, and then I need access to 
those GL texture handles for manually drawing them onto a different frame 
buffer.

 

I know Scene3D creates its own FBO, but after digging through Qt source, I 
still don’t understand how that interacts with QRenderTarget nodes in the frame 
graph.  It is “illegal” to have this kind of graph with Scene3D? 

 

Thanks!

 

Gil

 

 

 

From: Interest <interest-boun...@qt-project.org> on behalf of Gil H 
<q...@tastytech.ca>
Date: Wednesday, August 7, 2019 at 9:46 AM
To: Qt Interest <interest@qt-project.org>
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

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-boun...@qt-project.org> on behalf of Sean Harmer 
<s...@theharmers.co.uk>
Date: Wednesday, August 7, 2019 at 4:40 AM
To: Qt Interest <interest@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.

Cheers,

Sean

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@qt-project.org
https://lists.qt-project.org/listinfo/interest
_______________________________________________ Interest mailing list 
Interest@qt-project.org https://lists.qt-project.org/listinfo/interest 

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

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

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

Reply via email to