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     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 😀

This entry was posted in Coding, Compiz, Open Source. Bookmark the permalink.

15 Responses to New Compiz Shatter Effect!

  1. Vadim P. says:

    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: “http://ppa.launchpad.net/kdub/ubuntu 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)

  2. Vadim P. says:

    The link failed to linkfy properly – should point to “apt:cf-kdubois-extra-animations”

  3. Vadim P. says:

    Oi, last one for today… but Animations Plus is refusing to stay on. I check it and it unchecks itself after a few moments.

  4. Kevin says:

    Thanks for pointing things out, I hope my edits resolve any problems

  5. Dread Knight says:

    I would really use this!

    Hope it will get implemented in Kwin-KDE4 as well 🙂

  6. rafe says:

    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?

  7. Kevin says:

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

  8. Vadim P. says:

    Ah yeah… I got the 0.7.6 version of Compiz from the compiz ppa (for the cylinder :))

  9. rafe says:

    Thanks, it was just the “Fading Windows”—stupid question.

  10. Fred says:

    The “this guide” link for compiling is borked.

  11. Arve says:

    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://anongit.compiz-fusion.org/users/kdubois/extra-animations
    cd extra-animations
    make install

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

  12. obiora says:

    Animation Plus is refusing to stay on. I check it and it unchecks itself after a few moments. please what do i do

  13. mike says:

    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

  14. jordan says:

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

    • Kevin says:

      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 *