The following is the normalize code of GLM. Unfortunately an exception is going to be thrown out if the vector is likely to be zero. It's not good to throw the exception which crushes the program. I ...
// compute the vector of the surface to the view/camera // and pass it to the fragment shader v_surfaceToView = normalize(u_viewWorldPosition -surfaceWorldPosition); but then these values will be ...