[Development] Fwd: ShaderEffect on animated custom OpenGL QQuickItem is not animated.

Dr. André Bergner andre.bergner.0 at googlemail.com
Tue Jul 9 09:11:00 CEST 2013


Hi Qt-devs,

I have problems applying a ShaderEffect to a custom QQuickItem drawing
raw OpenGL directives.

I have a little QML script as test case, which I copied from here:
http://qt-project.org/doc/qt-5.0/qtgraphicaleffects/qml-qtgraphicaleffects1-gaussianblur.html

I replaced the image of that example with my custom QQuickItem drawing
raw OpenGL. This custom item I created following this example:
http://doc-snapshot.qt-project.org/qt5-stable/qtquick/scenegraph-textureinsgnode-fboinsgrenderer-cpp.html
I.e., I subclassed QQuickItem. Within updatePaintNode I generate a new
QSGSimpleTextureNode having a FBO as texture. On the
QQuickWindow::beforeRendering signal I draw my OpenGL stuff into that
FBO.

My custom OpenGLItem has some property exposed to QML and is animated
using a Timer within the QML script.


Now, my problem is that while the Blur is inactive my custom OpenGL
code is nicely drawn into the item and animated properly. When I
switch on the shader the shader is computed only once and stays then
static. The animation -- even though still rendered into the FBO -- is
not picked up by the ShaderEffect item. The only way to trigger an
update of the shader. This will generate a new QSGSimpleTextureNode
with a fresh FBO.

When I test the Blur with a small animated Rectangle put inside
another Rectangle this animation is visible within the blur.

What do I need to add to my custom QQuickItem in order to signal
changes and trigger redraws of dependent items such as that blur? I
could not find any apportierte signal. What else do I miss?


Thanks a lot in advance,
André
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130709/93a61de9/attachment.html>


More information about the Development mailing list