The result of a blogging accident

Night vision colour filter for Compiz

I’ve hacked together a really quick colour filter for Compiz that is a “night vision mode”. That is, it turns everything to greyscale, then drops the green and blue channels to make everything red.

Such themes are typically popular with astronomers and anyone else who works with a computer in a dark place.

Be aware that Compiz defaults to a “composite” colour filtering mode, that is, it applies all of your colour filters by default. You may want to remove your other colour filters if you don’t use them after adding this one, otherwise you may come up with undesired results. It also doesn’t apply the filter to the root window (your desktop wallpaper and icons), so you may want to change your wallpaper appropriately and remove your desktop icons.

The filter code:

TEMP tex;
TEX tex, fragment.texcoord[0], texture[0], RECT;
DP3 tex.r, tex, {0.33333, 0.33333, 0.33333, 0};
MUL tex, tex, {1.0, 0, 0, 1.0};
MOV result.color, tex.rgga;