Improved gpu particle calculations in shader.