Search code examples
clutter

Effect behind a Clutter Actor


How would it possible to make an actor apply an effect on what's behind itself in Clutter ?

For example it could be a blur effect and we'd have something like this : https://i.sstatic.net/1ijs3.png

It is possible to add a ClutterEffect to an Actor but this will apply to the actor's content not what's behind it.

I could use this tutorial in order to draw a blurry background for my actor, but I would still need access to the rendered pixel data of what's behind my actor to apply blur on it.

(This is the same question as here but I coudn't find any answer)


Solution

  • No, you can't.

    Actors are drawn in order, and effects are applied during each actor's paint cycle. This means that, in order to draw what's behind an actor, you'd have to draw the whole scene (as actors deeper in the graph may end up being drawn behind actors that have already been painted) without your actor, then redraw your actor on top - and then draw fully opaque actors that may cover your actor.