GLSL normalize and length on zero vectors

Hi!

Thanks for the link. But even if I check the length
like I would do in a software normalize function
I wonder how I should handle length == 0 in the
shader… I mean for example I calculate some
direction vector for a light source or for eye
position and do some lighting calculation based
on this direction vector.

But if I am not able to calculate this direction
vector because he is just zero how should I proceed?
I guess this would require a lot of extra code
for checking and handling this edge case that
might slow down the whole shader? :frowning:

But on the other side it could happen quite often
if my light source touches an object’s triangle
or vertex.