I have attached an updated version of the prototype to QTBUG-19902<https://bugreports.qt.nokia.com/browse/QTBUG-19902>. This has two main changes:
* Clean up of the mechanism for binding FBO content as Item3D material * Introduction of a second QML extension which streams video to an Item3D material, without going via an FBO on the way Gareth ________________________________ From: Stockwell Gareth (EXT-Accenture/UnitedKingdom) Sent: Monday, September 05, 2011 4:20 PM To: Smith Sarah.J (Nokia-MP-Qt/Brisbane) Cc: [email protected] Subject: RE: [Qt-3d] Redirect item painting and use content as a material Hi Sarah, I have implemented a prototype, and attached it to QTBUG-19902<https://bugreports.qt.nokia.com/browse/QTBUG-19902>. At present, it always first paints into an FBO, and then extracts a texture handle which is made available to QML via a QGLMaterial. As you say, for video streaming it would be better to avoid going via the FBO - I'll have a go at that next. The other drawback of the current code is that it requires both the source and the target items of the FBO content to be specified in QML. Specification of the target is necessary in order to trigger a QDeclarativeItem3D::update() whenever new content is written into the FBO. I think that this wouldn't be necessary if QGLMaterial had a signal to say that the texture content had changed, but AFAICS there isn't one at present. Regards, Gareth ________________________________ From: Smith Sarah.J (Nokia-MP-Qt/Brisbane) Sent: Tuesday, August 23, 2011 2:32 AM To: Stockwell Gareth (EXT-Accenture/UnitedKingdom) Cc: [email protected] Subject: Re: [Qt-3d] Redirect item painting and use content as a material Hi Gareth, Yes - that looks very reasonable, and I think its something a number of Qt Quick 3D users will want to do. We don't have support for that just yet. We do have an item on the roadmap for FBO support which should include the thing you're asking for: https://bugreports.qt.nokia.com/browse/QTBUG-19902. We were hoping to do it for our September release but we've been snowed under and its now set down for 1.0 which is Q1 2012. The exact thing you need is not that big a job, especially since I'm guessing for expediency you'll want to make some platform assumptions about texture streaming extensions available for your target, but nonetheless the code could be a useful contribution if you wanted to send it to us once you get it working. :-) Regards, Sarah Smith Senior Engineer Team Lead Qt3D Nokia Qt Development Frameworks Mobile: +61 448 283 476 [email protected]<mailto:[email protected]> On 22/08/2011, at 9:41 PM, ext [email protected]<mailto:[email protected]> wrote: Hi, I'm looking for a way to redirect the painting of an Item so that, instead of going into the QML viewport, it goes into an FBO or texture, and is therefore available as a material. Specifically, I'd like to do this to a Video item, so that the video content can be mapped onto a 3D object (see QTMOBILITY-1818<https://bugreports.qt.nokia.com/browse/QTMOBILITY-1818>). Here's a rough sketch of what I'd like to do: import QtMultimediaKit 1.1 import Qt3D 1.0 import Qt3D.Shapes 1.0 Viewport { id: viewport Video { id: video source: "testclip.mp4" anchors.fill: parent } // Redirect painting of "video" into an FBO, a la ShaderEffectItem ContentCaptureItem { id: capture source: video } Cube { id: cube // Generate a texture from the FBO, and apply it to the faces // of the cube. // Each time a new video frame is generated, the texture content // is updated and the cube is redrawn effect: Effect { material: capture.material } } } In addition to redirecting the painting of its source item, the ContentCaptureItem would also need to trigger a repainting of the cube whenever a new video frame was generated. It may be possible to do this via the QGLMaterial object which connects the FBO and the cube item; alternatively it may be necessary to specify the consumer explicitly when instantiating the ContentCaptureItem: ContentCaptureItem { id: capture source: video target: cube } Is there currently any support in QtQuick3D for doing this? If not, would a good approach be to write a plugin providing the ContentCaptureItem (probably reusing much of the code from the ShaderEffectItem<http://labs.qt.nokia.com/2011/05/03/qml-shadereffectitem-on-qgraphicsview/> plugin)? Regards, Gareth <ATT00001..txt>
_______________________________________________ Qt-3d mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-3d
