Reorganised shader code