This branch demonstrates a possible implementation of a
blurred window effect without making major changes to the
underlying rendering mechanism of the compositor.
By exploiting the graphics engine's use of scanline-based
clipping, we can reliably perform horizontal blurs on the
existing backbuffer when rendering each frame, before we
render the "blurry" window.
This approach is missing several things:
- Ideally, another mask channel is needed to specify which
parts of the window should be blurred, rather than trying
to co-opt the window shape derived from the alpha channel.
- The blur amount should vary based on the alpha transparency
of the window object, especially during transitions. It is
unclear how to do this well alongside transformations.
- The horizontal-only blur is visually lacking, and ideally
we would want a full box blur for the best effect, but
no feasible approach to this with our rendering model has
been deduced to this point.
If more research is to be done in this area, redesigning the
rendering approach may be the next step.
There are a few other approaches that could be used:
- We could restrict the renderer to one (or two...) blurred
windows - particularly, the focused window at the top of
the main display stack. This would allow us to keep a
secondary backbuffer with only the lower windows at each
render stage, which could always be sourced for the blur.
If we do this twice, once for the top main window and once
for the panel level, we could produce solid effects, but
it requires shoveling a lot of extra pixel data around.
- We could try to cheat the clipping and redraw a bit extra
around blurred windows, but this gets complicated...
Ultimately, a GPU-accelerated pixel shader implementation that
can operate on the full scene with each frame is likely the
only way that an acceptable blur effect can be achieved.
Since OpenWeather doesn't provide this with their API,
we query ip-api.com, which has a free geoip location service
and we can even restrict the data pulled in from it so we're
not storing more sensitive data than just a city. Seems to
work okay in Japan, but I'll try it from other locations...