Yep, same thing. sqr(x*x+y*y+z*z) is the magnitude, and you're dividing by it and klepto is multiplying by (1 dividided by the magnitude). 6 and two 3s.
To smooth the light colouring, you'll have to look into vertex colouring. I don't know OpenGL or Direct3d, so you're on your own on that one.
To smooth the light colouring, you'll have to look into vertex colouring. I don't know OpenGL or Direct3d, so you're on your own on that one.