[Interest] QtQuick2 FBO QQuickItem for rendering OpenGL issue on Playbook

Sean Harmer sean.harmer at kdab.com
Sat May 11 12:45:28 CEST 2013


On 10/05/2013 22:15, Preet wrote:
> After playing around with this, it seems that the issues go away when 
> I bind my texture to unit 0, but not to unit 1 (which I was using 
> previously). Someone on the IRC channel confirmed they had come across 
> this too. Does this mean I can't use multitexturing in custom OpenGL 
> code within the scene graph? Is there anyway I can tell the scene 
> graph to rebind whatever it had attached to those units (if that is 
> indeed the issue?)

As you have found, integrating Qt Quick 2 with custom OpenGL rendering 
requires some care at present with respect to resetting the state that 
Qt Quick expects to have.

Typical things to consider are vertex array state and texture state. You 
can query these before you begin your rendering and then reset to this 
state at the end of your rendering. Hopefully at some point we'll see 
the addition of a pair of helper functions to do this akin to 
beginNativePainting() and endNativePainting().

Cheers,

Sean

>
>
> Regards,
>
> Preet
>
>
> On Fri, May 10, 2013 at 3:46 PM, Preet <prismatic.project at gmail.com 
> <mailto:prismatic.project at gmail.com>> wrote:
>
>     Hiya,
>
>     I have a QQuickItem based off this example
>     (http://doc-snapshot.qt-project.org/qt5-dev/qtquick/quick-scenegraph-textureinsgnode.html)
>     which shows how to use a QSGSimpleTextureNode as a FBO.
>
>     I render a simple textured plane to the FBO, here's what it looks
>     like on my desktop (Linux):
>     http://i.imgur.com/YXhQafw.png. The dark blue shows the extent of
>     the FBO.
>
>     Here's what it looks like on the playbook:
>     http://i.imgur.com/BRrROca.png. The texture of the FBO has become
>     the texture that's supposed to be used in the 3d scene.
>
>     Here's what the same scene looks like on the playbook without any
>     textures, just a colored plane: http://i.imgur.com/zDns3tY.png ...
>     this works as expected.
>
>     Something weird's going on with textures. I tried adding an Image
>     {} element in my QML file with the textured 3d scene.
>
>     What it should look like [image on the right, fbo n the left]
>     (desktop):
>     http://i.imgur.com/vaWksww.png
>
>     What it does look like (playbook):
>     http://i.imgur.com/a9iEntg.png
>
>     Is it possible that this is a bug? Or something specific to OpenGL
>     ES 2 I'm not accounting for (I don't have any other ES 2 devices
>     to test with)?
>
>     I'd appreciate any input. I'm using Qt 5.1 Alpha.
>
>
>     Preet
>
>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest


-- 
Dr Sean Harmer | sean.harmer at kdab.com | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130511/9f384cf7/attachment.html>


More information about the Interest mailing list