mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
wiki: Add expanding circle example to window-open
This commit is contained in:
@@ -105,9 +105,24 @@ vec4 default_open(vec3 coords_geo, vec3 size_geo) {
|
||||
return color;
|
||||
}
|
||||
|
||||
// Example: show the window as an expanding circle.
|
||||
// Recommended setting: duration-ms 250
|
||||
vec4 expanding_circle(vec3 coords_geo, vec3 size_geo) {
|
||||
vec3 coords_tex = niri_geo_to_tex * coords_geo;
|
||||
vec4 color = texture2D(niri_tex, coords_tex.st);
|
||||
|
||||
vec2 coords = (coords_geo.xy - vec2(0.5, 0.5)) * size_geo.xy * 2.0;
|
||||
coords = coords / length(size_geo.xy);
|
||||
float p = niri_clamped_progress;
|
||||
if (p * p <= dot(coords, coords))
|
||||
color = vec4(0.0);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
// This is the function that you must define.
|
||||
vec4 open_color(vec3 coords_geo, vec3 size_geo) {
|
||||
// You can pick one of the example functions or write your own.
|
||||
return solid_gradient(coords_geo, size_geo);
|
||||
return expanding_circle(coords_geo, size_geo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user