Does Anyone Know How Dithering Works in “Ultima Underworld”?

Ultima fan (and fan project developer) arbraini has been exploring the game engine powering Ultima Underworld and its sequel, and has hit a stumbling block when attempting to figure out what sort of logic the engine applies when applying dithering to colours in textures:

i like dither…

i can’t figure out Ultima Underworld’s dither logic. its simple 2×2 dither but its not applied across the whole screen, since the dither changes when you move. and its not part of the texture data either. when and how does UW decide to apply the dither???

i am starting to see a patter in UW2… or i’m going nuts. it looks like the dither is on the color space to expand the limited palette,

    arbraini posted two sample images to Discord; one of them is above, and this is the other:

    My own guess as to the logic being applied here was that the amount of dither was directly correlated to the colour delta between one pixel (or block of pixels) and its neighbour(s): more delta, more dither; less delta, less dither. But as arbraini pointed out, sometimes there are large, neighbouring blocks with distinct colors that don’t have any dither applied, which would appear to be an argument against the logic being as simple as just blending neighbouring colours.

    So consider this an open question: how does the dithering logic in the Ultima Underworld/Ultima Underworld 2 game engine actually work?

    1 Response

    1. Natreg says:

      I can’t check right now, but is it not generated by the shadows file? I seem to remember there was a file that generated the shadows over the screen. You can rename it and check if the dithering appears. The game can work withouth that file.