optimizing particle transition shader code for better performance