This patch replaces M_PI / 2 and M_PI * 0.5 with M_PI_2.
Similarly, M_PI / 4 and M_PI * 0.25 is replaced with M_PI_4.
The constant M_PI_4 is added to GLSL to ensure it works there too.
Two cases of (1/(pi/2)) were also replaced with the equivalent, M_2_PI (2/pi).