diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-22 19:05:11 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-22 19:05:11 +0400 |
| commit | 1681ed16d91757d98dc3eb653b970e706ff84b78 (patch) | |
| tree | b7822a2b49ecc4f9824b28c3b6c93d50ac2e01eb /wiki/Configuration:-Animations.md | |
| parent | d4bed7088441f76eb92d35e53c3af4301c6e01d3 (diff) | |
| download | niri-1681ed16d91757d98dc3eb653b970e706ff84b78.tar.gz niri-1681ed16d91757d98dc3eb653b970e706ff84b78.tar.bz2 niri-1681ed16d91757d98dc3eb653b970e706ff84b78.zip | |
Change custom-shader to a prelude-epilogue system
Diffstat (limited to 'wiki/Configuration:-Animations.md')
| -rw-r--r-- | wiki/Configuration:-Animations.md | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/wiki/Configuration:-Animations.md b/wiki/Configuration:-Animations.md index 8c933fdd..440d10fa 100644 --- a/wiki/Configuration:-Animations.md +++ b/wiki/Configuration:-Animations.md @@ -234,31 +234,23 @@ See [this example shader](./examples/resize-custom-shader.frag) for a full docum If a custom shader fails to compile, niri will print a warning and fall back to the default, or previous successfully compiled shader. -> [!NOTE] +> [!WARNING] > > Custom shaders do not have a backwards compatibility guarantee. > I may need to change their interface as I'm developing new features. +Example: resize will show the next (after resize) window texture right away, stretched to the current geometry. + ``` animations { window-resize { spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 custom-shader r" - #version 100 - precision mediump float; - - varying vec2 v_coords; - uniform mat3 input_to_curr_geo; - uniform sampler2D tex_next; - uniform mat3 geo_to_tex_next; - uniform float alpha; - - void main() { - vec3 coords_curr_geo = input_to_curr_geo * vec3(v_coords, 1.0); - vec3 coords_tex_next = geo_to_tex_next * coords_curr_geo; - vec4 color = texture2D(tex_next, vec2(coords_tex_next)); - gl_FragColor = color * alpha; + vec4 resize_color(vec3 coords_curr_geo, vec3 size_curr_geo) { + vec3 coords_tex_next = niri_geo_to_tex_next * coords_curr_geo; + vec4 color = texture2D(niri_tex_next, coords_tex_next.st); + return color; } " } |
