📝 Add note why the matrix effect is not available on GNOME 3.3x

This commit is contained in:
Simon Schneegans
2021-12-25 13:03:03 +01:00
parent c5aa8b9268
commit aa33667cae
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
#### New Features #### New Features
* Added a new Matrix shader which dissolves your windows in a shower of green letters. You can switch between the fire and the matrix shader in the settings. * Added a new Matrix shader which dissolves your windows in a shower of green letters. You can switch between the fire and the matrix shader in the settings. Sadly, this effect cannot be available under GNOME 3.3x as it was apparently impossible to set textures for a `Clutter.ShaderEffect` in GJS back then.
#### Other Enhancements #### Other Enhancements
+6 -1
View File
@@ -23,6 +23,8 @@ const shaderSnippets = Me.imports.src.extension.shaderSnippets;
// The MatrixShader multiplies a grid of random letters with some gradients which are // // The MatrixShader multiplies a grid of random letters with some gradients which are //
// moving from top to bottom. The speed of the moving gradients is chosen randomly. // // moving from top to bottom. The speed of the moving gradients is chosen randomly. //
// Also, there is a random delay making the gradients not drop all at the same time. // // Also, there is a random delay making the gradients not drop all at the same time. //
// This effect is not available on GNOME 3.3x, due to the limitation described in the //
// documentation of vfunc_paint_target further down in this file. //
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
var MatrixShader = GObject.registerClass({Properties: {}, Signals: {}}, var MatrixShader = GObject.registerClass({Properties: {}, Signals: {}},
@@ -130,7 +132,10 @@ var MatrixShader = GObject.registerClass({Properties: {}, Signals: {}},
`); `);
}; };
// This is overridden to bind the font texture for drawing. // This is overridden to bind the font texture for drawing. Sadly, this seems to be
// impossible under GNOME 3.3x as this.get_pipeline() is not available. It was called
// get_target() back then but this is not wrapped in GJS.
// https://gitlab.gnome.org/GNOME/mutter/-/blob/gnome-3-36/clutter/clutter/clutter-offscreen-effect.c#L598
vfunc_paint_target(node, paint_context) { vfunc_paint_target(node, paint_context) {
const pipeline = this.get_pipeline(); const pipeline = this.get_pipeline();
pipeline.set_layer_texture(1, this._fontTexture.get_texture()); pipeline.set_layer_texture(1, this._fontTexture.get_texture());