Modifying shader values with MIDI

Instead of using on-screen sliders and buttons to tweak colors and other properties I decided to try MIDI. Simple MIDI devices are cheap and have enough features so I got myself a Korg NanoKontrol and a Korg NanoPad.

The application running on a Windows PC communicates with the USB MIDI devices and passes the information to the Android (HTC Desire Z) and Maemo (Nokia N900) devices over a TCP socket (WLAN). The application features a spinning logo with tweakable material values and postprocessing properties. The graphics are drawn with OpenGL ES 2.0 and the MIDI data is used to modify the shader uniforms and camera position.

The next step is to record the data. It can then be used in demo projects by playing it back.

Posted in Graphics programming | Leave a comment

Dithering images for 16-bit displays

Back in 2008 when I was working on the Daydream -demo for the GP2X I was looking for a way to dither images for 16-bit displays. We used various linear gradient backgrounds and on the GP2X the banding was a big problem. I did some research on the matter couldn’t find a solution so I devised my own.

By preprocessing the RGB888 images into RGB565 and adding some simple dithering, the lack of color depth is hidden very efficiently. It may not be perfect but on the target device the result looks very good. Below is an image that illustrates the problem and the result.

I wrote a simple plug-in for Adobe Photoshop for processing the images. Support for other bit depths than 565 might be added later. The package contains 32bit and 64bit versions and has been tested on CS2, CS4 and CS5.

Color depth plug-in for Photoshop v1.01.

Posted in Image processing | 1 Comment

Making Windows Live Messenger window flashing less annoying

I’ve been using Windows Live Messenger for years but recently I’ve been annoyed by its flashing message windows. If there are open message windows and a new message is received the window flashes constantly for one minute or until it receives input focus. This is very annoying if you are in the middle of something else and don’t want to read the message just yet. Unfortunately the flashing behavior cannot be configured or disabled from the settings. I could use some other alternative client but I like the official one especially after cleaning it up a bit with the A-Patch.

Today I decided to try changing the behavior by modifying the executable itself. With the help of IDA I figured out how the application does the flashing. When a message is received a timer is set with SetTimer to call a function every 1500ms which makes the window flash with FlashWindow. Once the location of the timer value was known it was easy to change it with a hex editor and make the flashing less intrusive. Just by changing the value from 1500ms to for example 15000ms helped a lot.

To change the value, open msnmsgr.exe with a hex editor (HHD Software Free Hex Editor Neo is nice) and look for the first and only occurrence of the hex string “68 DC 05 00 00 68 C8 00 00 00″. Remember to take a backup of the file first. For the 2009 version (build 14.0.8117.416) it is at 0x00167C4A. For the latest 2011 version (build 15.4.3508.1109) it is at 0x002407A4.

The first half of the data block defines the timer value and the second one is the identifier for the timer event. “DC 05″ translates to 1500 and to set the timer to 15000ms, replace it with “98 3A”. Save changes, start Messenger and enjoy.

Posted in Hacks | 3 Comments

A new beginning

After over 10 years of using my home made Perl -based CMS I finally decided to switch to WordPress. The old site was pretty inactive for the last couple of years but I’m planning to change that with this new one.

Posted in Uncategorized | Leave a comment