Coding,  Compiz,  Open Source

New Compiz Shatter Effect!

Digg This!

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 hardy main
deb-src hardy main

to /etc/apt/sources.list OR by running

sudo su -c 'echo deb hardy main >> /etc/apt/sources.list'
sudo su -c 'echo deb-src 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

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://
cd extra-animations && make install

Sorry for any inconveince, I am very new to official-style debian packaging 😀


  • Vadim P.

    Love it!

    But newb friendly instructions (because we need to get away from the command-line stigma):

    – Go to System – Administration – Software Sources, and click on the Third-Party Software tab.
    – Click Add, paste this line in: “ hardy main”, then click Add Source, Close, and Reload.
    – Click here to install the plugin
    – Go to System – Administration – Advanced Desktop Effects Settings
    – (and the rest of instructions are the same)

  • rafe

    I got it all installed easily enough, but I can’t get the effect to last long enough to really tell what’s going on. I can see that the window is being broken, but the pieces fade before they really fall anywhere. I did notice that if I reopen the same folder or application quickly enough, I see the pieces falling to the bottom of the screen before they fade again—any ideas for me?

  • Kevin

    try disabling the “fading windows” plugin and increasing the animation’s effect duration. Disabling Fading Windows has a great effect.

  • Arve

    I had problems with the plugin turning itself off immidiately. Using an updated version of Compiz ( and U-8.10 intrepid )

    Ran the following successfully:

    sudo apt-get install compiz-dev
    git clone git://
    cd extra-animations
    make install

    Plugin now loads up nicely, but Shatter doesn’t show up anywhere. Only Helix and Blinds.

  • mike

    works like a charm man!!….linux mint elyssa 32bit fresh install with xmms….compiz 0.74…disabled window fading…wow …amd 64 4000 1 gig ram on msi board…thanx

  • jordan

    hey when i try to make install i get the error 1. something about glxPixmaps… not my specialty. anybody care to help?

    • Kevin

      for starters, you’ll need to be trying to compile compiz fusion, and you have to have all the development headers for opengl installed…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.