Adaptation of shader (Janino)

Original written by Mark Thorpe