I’m trying to apply a shader effect on the entire screen, and I need to pass an uniform texture to this shader, but I don’t know if it is possible at all.
This is a snippet I tried to get to work, with a simple shader that should lower the red component of the frame. But it’s not working properly.
I have also tried to use a Clutter.Timeline like shown here but it seems to change nothing, and peg one core at 100%.
Then you should be able to use global.stage.add_effect_with_name("effect", effect) and global.stage.remove_effect_by_name("effect") to enable and disable the effect. Which is what the extension does. But instead, adding the effect just freezes the screen, and removing it unfreezes it.
Doing the exact same commands, but in a shell extension, applies the shader, but it’s broken. This is weird because simpler effects like Clutter.DesaturateEffect({factor: 0.5}) work the same in LookingGlass or an extension.
when using the extension, the observed behaviours are:
the effect gets progressively “stronger”, like the shader is run multiple times per frame
after “reaching a certain strength” some artifacts appears
disabling the effect brings everything back to normal.
Again, none of this happens for other effects like Clutter.DesaturateEffect({factor: 0.5}), which just works as expected.
Instead, for the “passing a texture” part of the question i have no snippet. I don’t even know where to start.