Minor refactoring in shader code, add scan distortion, code layout