Artifacts from fragment shading in OpenGL

This is a floating point precision issue. Note the vertex coordinates are interpolated when for each fragment. It may always lead to issues, when comparing floating point numbers on equality.

On possible solution would be to use an epsilon (e.g. 0.01) and to change the comparison to < -0.99 and > 0.99:

if (ex_Normal.z > 0.99) {
    lightAmplifier = .8;
} else if (ex_Normal.x > 0.99) {
    lightAmplifier = .65;
} else if (ex_Normal.x < -0.99) {
    lightAmplifier = .50;
} 


Another possibility would be to use the flat interpolation qualifier, which causes the value not to be interpolated:

Vertex shader:

flat out vec3 ex_Normal;

Fragment shader:

flat in vec3 ex_Normal;

Rabbid76 is (probably) right about the erroneous appearance being a result of floating point accuracy/precision.

What I'd like to add is that setting a constant value based on testing an interpolated value is rarely a good idea (some algorithms do depend on it though, e.g. shadow mapping). Changing the test from ==1 to >=0.99 just puts the error at 0.99 intead of at 1.0. It is more likely you want to interpolate the value when it enters a certain range, e.g. by using mix.