Skip to content

Feat/transition anim#3531

Open
Atan-D-RP4 wants to merge 6 commits intoniri-wm:mainfrom
Atan-D-RP4:feat/transition-anim
Open

Feat/transition anim#3531
Atan-D-RP4 wants to merge 6 commits intoniri-wm:mainfrom
Atan-D-RP4:feat/transition-anim

Conversation

@Atan-D-RP4
Copy link

@Atan-D-RP4 Atan-D-RP4 commented Feb 27, 2026

Intending to implement full animations for the do-screen-transition action 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

@Atan-D-RP4 Atan-D-RP4 force-pushed the feat/transition-anim branch from 4fb4154 to 288e167 Compare March 1, 2026 19:07
@Atan-D-RP4 Atan-D-RP4 marked this pull request as ready for review March 1, 2026 19:07
Copilot AI review requested due to automatic review settings March 1, 2026 19:07
@Atan-D-RP4
Copy link
Author

It kinda works.

260302_00h38m54s_recording.mp4

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ScreenTransition to be driven by Animation config (with delay support) and optionally render via a custom shader program.
  • Adds shader plumbing for a new ScreenTransition program type, including prelude/epilogue fragments and config-driven compilation/loading.
  • Extends configuration and docs to expose animations.screen-transition with custom-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.

Comment on lines +479 to +480
vec3 coords_tex_next = niri_geo_to_tex_next * coords_curr_geo;
vec4 color = texture2D(niri_tex_next, coords_tex_next.st);
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants