PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Gapidraw on 12 bits displays

I'm currently developing a game that is a follow-up to an old game. When the old game was released, only 12 bits displays existed and that game used some form of 12 bit dithering so that graphics looked better on such displays. Now, the new version of the game (which I'm developing using Gapidraw) uses some of the graphics of the old game and I received some complaints of beta testers that those re-used graphics look worse in the new version, probably because gapidraw doesn't do the same kind of dithering the old game used. Since I don't have a 12 bits display myself, I can't really judge this issue, but I was wondering how Gapidraw handles blitting on 12 bits displays and how things normally look on those older devices.
Hi,

No dithering in the blit functions since real-time dithering is really slow...

I would suggest that you implement a simple dithering in CreateSurfaces to dither your source bitmaps before the actual game is started (when you're at it you could add a simple gamma adjustment as well :) ).

/Johan
I was under the impression that the ARM video controller was doing dithering for you...
The video controller does some sort of realtime dithering, but this results in color-banding, that's why I want to have a better dithering algorithm (some kind of error diffusion).
One more thing though: does anyone know if there is a way to detect that the hardware is 12 bits? Internally, the memory layout is always 16 bits, even when the hardware can only display 12 bits, and GXGetDisplayProperties returns a colordepth of 16 bits on both 12 and 16 bits hardware.
Current 12-bit displays use 16-bits for their color representation in memory, but will only show 12 of these bits when the display is updated. The banding is no "realtime dithering", but simply the video controller throwing away the 4 lowest bits of color information.

The only way to detect a 12-bit display is by quering the device type (e.g. "if this device is a 3600 or XDA I know the display is 12-bit").

Best results are achieved if you dither your images yourself during CreateSurfaces() if the device only has a 12-bit display.
There's no way to tell if the display is native 12-bpp. The best thing for you to do is to add an option in your game where the user can toggle dithering on/off. If they want to pay the perf hit for a better looking display on 12-bpp devices, then it's their choice. Maybe you can detect the device and only enable the dither option checkbox if the game is running on what you assume is a 12-bpp device, but please allow the user some way to control this.

I did a lot of dithering work a year or so ago and got it to the point it wasn't that much of a perf hit. No one is making 12-bpp devices anymore so I shelved it. Search through the archives for my previous posts on the subject, or send me a private message on this site and I'll tell you all you ever wanted to know about dithering.