The Golem of Prague

November 23, 2021

This is an entry for @sableRaph's weekly creative coding challenge. The theme for this week was book covers. I just finished reading the novel The Golem and the Jinni by Helene Wecker so, with golem stories on my mind, I made a generative cover for the classic Golem tale.

Smudge shader

In the story, a man made of clay is brought to life by inscribing the letters אמת (meaning "truth") into it. After it gets out of control, it can be killed by erasing the first letter so that the text instead spells מת (meaning "death.") So, at the top of my cover, I've got that first letter smudged out.

The smudge shader takes in two images as inputs:

  1. An unsmudged image
  2. An image where each pixel value actually reprents an offset vector instead of a colour, indicating that the colour shown in the final image should be smudged over from that offsetted location

The shader combines these two inputs, producing an output whose colours come from the colour of the original image at the offsetted location specified by the offset input.

It also adds some noise to the offset proportional to the distance, giving the smudge a rougher texture.