Skip to content

[FEATURE] Inform shaders the workspace being switched to and from, to allow per-workspace animations more easily #968

Backlog

Description

@0x70369

What problem would this solve?

A reveal shader can't tell which workspaces it is animating. Besides the
common animation uniforms (umbriel_progress, umbriel_clamped_progress,
umbriel_linear_progress, umbriel_direction, umbriel_random_seed), it
only gets umbriel_workspace_axis, which gives the direction of the switch
but not the workspaces themselves.

Workspace rules don't help either, since they only accept layout.* fields, so
there is no way to assign a different effect, or effect parameters, to each
workspace.

What I want to do

I'm writing a custom animation.workspaces effect with style = "reveal".
I want the transition to depend on which workspaces are involved. In my
case, every workspace has its own glass tint, so the shader needs to know
the colour of the workspace it is leaving and of the one it is entering.

What would a better experience look like?

My end goal is to have an animation similar to moving through a glass object
in Smash Hit, with workspace N having the colour accents of checkpoint N.
The animation itself and the glass effect are already possible,
just the per-workspace colour tinting of the glass that's not yet achievable.

Possible approach

Add one uniform next to umbriel_workspace_axis in
src/workspace/workspace.cpp, where the reveal parameters are filled in for
both trees:

// one-based indices: x = workspace being left, y = workspace entered
uniform vec2 umbriel_workspace_indices;

It would be filled from the slide's base and target workspaces, the same way
umbriel_workspace_axis is, and documented under "Workspace reveal" in
docs/user/animation.md (umbriel_workspace_axis isn't documented there
yet either, so both could be added together).

With it, a shader can pick per-workspace parameters from a small table, for
example:

const vec3 TINTS[9] = ...;
vec3 from = TINTS[int(umbriel_workspace_indices.x) - 1];
vec3 to = TINTS[int(umbriel_workspace_indices.y) - 1];

(GLSL ES 1.00 doesn't allow constant array initialisers, so in practice it
would be a small if/else chain, but the idea is the same.)

What have you tried?

I've considered adding individual rules for each workspace,
but this would become unwieldy fast, especially if I decide to
change the entire animation for a completely different one.

Area

Rendering (blur, shadows, borders, corners, animation)

Examples or references

Here's a video of the game, the glass' appearance in the
obstacles is what I wish to recreate with this animation in Umbriel.

How would you like to help?

  • I can test an implementation in my own session.
  • I might be interested in implementing this after we discuss the scope.

Anything else?

Disclaimer
I'm not familiar with C++, so I asked Claude for help to see if this
is possible in Umbriel right now, as well as to write this feature request.
If the affirmations here are wrong, please correct me, and my sincere apologies.

Activity

  1. added
    enhancement
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions