[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
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:
I replaced the image of that example with my custom QQuickItem drawing
raw OpenGL. This custom item I created following this example:
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
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,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Development