For a while now, I’ve wanted an effect for Compiz Fusion that makes closing windows look like shattering glass. I finally got around to coding it up, and am pretty pleased with the results! Take a look at the demo videos to see what I mean! Also, I took the time to make a debian package for Ubuntu Hardy, so you can easily install it, as well as get the other animations like Helix and Blinds that I’ve coded up! (Instructions for Ubuntu install after the videos)
Many medium sized windows shattering:
Effect in slowmo :
Basically, I split the window up radially from a central point, and then split each radial slice along concentric circles to create the tessellation. The angles, the number of slices, and the number of concentric tiers is all random, so it creates a different looking effect each time. I then have the pieces then fall to the bottom of the window like real shattered glass would. All in all, I had to write about 1400 lines of new code to get this working. There are a few more user customizable options I have left to throw in, but most of the heavy lifting is done. Roughly speaking, its about as computationally intensive as the “explode” animation.
Interested in installing these and trying them out? If you’re not on Ubuntu, follow this official guide to install compiz from source, and this guide to install my plugin. If you happen to be on Ubuntu though, I made a handy package that you can install and get these effects in less than 5 minutes. A bit of a disclaimer, this is my first experience with Launchpad’s PPA system, so don’t jump down my throat if I did something wrong. I’ve tested the package on a fresh Ubuntu install, and it works fine.
Installation Instructions for Ubuntu:
Add my Personal Package Archive to your /etc/apt/sources.list. This can be done by adding
deb http://ppa.launchpad.net/kdub/ubuntu hardy main deb-src http://ppa.launchpad.net/kdub/ubuntu hardy main
to /etc/apt/sources.list OR by running
sudo su -c 'echo deb http://ppa.launchpad.net/kdub/ubuntu hardy main >> /etc/apt/sources.list' sudo su -c 'echo deb-src http://ppa.launchpad.net/kdub/ubuntu hardy main >> /etc/apt/sources.list'
You can then install it by running
sudo apt-get update sudo apt-get install cf-kdubois-extra-animations ccsm
The last command will open up a GUI for configuring compiz that you need to turn extra-animations on. Under the “Extras” section, click Animations Plus, as shown here. It will automatically deactivate the old Animations plugin. If a dialog box appears to this effect, choose “disable animations”
You should see this:
Click on the Animations Plus icon to get an interface similar to the Animation plugin you can use to configure the effects. Shatter, Helix, and Blinds are new effects with this package. I would recommend a minimum of 500ms for the Shatter effect and 300ms for the Helix and Blinds Effects. Under the Effects Settings tab, you can configure many options for the three new plugins, as well as new tessellations (like Triangular Tessellations) for the Explode and Leafspread effects. For some reason, when I tried this out on a fresh Ubuntu Hardy install, I had to restart compiz to get it to refresh the effect settings.
There you go! I hope you enjoy the effects I wrote, and keep checking back for new effects!
EDIT: Thanks to Vadim P. for pointing this out, but this Ubuntu package will only work for the stock install image of Ubuntu (i.e. the version provided in a fresh install). If the plugin keeps deactivating itself, thats because there is a mismatch between the plugin version and the compiz core version. Try installing from source, it should be pretty easy too:
sudo apt-get install compiz-dev git clone git://anongit.compiz-fusion.org/users/kdubois/extra-animations cd extra-animations && make install
Sorry for any inconveince, I am very new to official-style debian packaging 😀