Finished GLSL shader that works fine.