Update to shader using Tom Dalling's code