Conversation
4fb4154 to
288e167
Compare
|
It kinda works. 260302_00h38m54s_recording.mp4 |
There was a problem hiding this comment.
Pull request overview
Implements configurable screen transition animations for the do-screen-transition action, including optional custom GLSL shader support to render the transition effect (useful for workspace switching effects outside overview).
Changes:
- Reworks
ScreenTransitionto be driven byAnimationconfig (with delay support) and optionally render via a custom shader program. - Adds shader plumbing for a new
ScreenTransitionprogram type, including prelude/epilogue fragments and config-driven compilation/loading. - Extends configuration and docs to expose
animations.screen-transitionwithcustom-shader.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/ui/screen_transition.rs |
Moves from hardcoded crossfade timing to configurable animation and adds shader-based rendering path with uniforms. |
src/render_helpers/shaders/screen_transition_prelude.frag |
Defines the uniform/varying interface exposed to custom screen transition shaders. |
src/render_helpers/shaders/screen_transition_epilogue.frag |
Provides the standardized main() wrapper calling screen_transition_color(...). |
src/render_helpers/shaders/mod.rs |
Adds ProgramType::ScreenTransition, storage, and compilation/loading of custom screen transition shaders. |
src/niri.rs |
Wires config reload + rendering callsite (incl. passing per-output mouse position) and uses new animation config when triggering transitions. |
src/backend/winit.rs |
Loads configured screen transition shader at backend init. |
src/backend/tty.rs |
Loads configured screen transition shader at backend init. |
niri-config/src/animations.rs |
Introduces ScreenTransitionAnim with anim and custom_shader, plus decoding/merging. |
niri-config/src/lib.rs |
Updates config tests/fixtures to include the new screen_transition animation defaults. |
docs/wiki/examples/screen_transition_custom_shader.frag |
Adds documented example shader + uniform interface description and sample effects. |
docs/wiki/Configuration:-Animations.md |
Documents screen-transition and custom-shader configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| vec3 coords_tex_next = niri_geo_to_tex_next * coords_curr_geo; | ||
| vec4 color = texture2D(niri_tex_next, coords_tex_next.st); |
There was a problem hiding this comment.
The custom-shader example for screen-transition references uniforms/textures (niri_geo_to_tex_next, niri_tex_next) that are not provided by the screen transition shader interface (it only exposes niri_geo_to_tex and niri_tex_from). This example as written won’t compile and is misleading for users; please update it to sample from niri_tex_from via niri_geo_to_tex (and fade based on niri_clamped_progress).
| vec3 coords_tex_next = niri_geo_to_tex_next * coords_curr_geo; | |
| vec4 color = texture2D(niri_tex_next, coords_tex_next.st); | |
| vec3 coords_tex = niri_geo_to_tex * coords_curr_geo; | |
| vec4 color = texture2D(niri_tex_from, coords_tex.st); |
Intending to implement full animations for the
do-screen-transitionaction with custom-shader support.Relevant discussion: #1620
The use-case is that I wanted more effects for workspace switch while overview is not enabled.
Extending the existing switch animation does not make sense design-wise and this action existed so this felt like a pretty natural workaround.
260227_21h55m23s_recording.mp4