# Point lighting in Graphics3D from too far away

Here's a simple cube:

cube[k_] := Graphics3D[{Lighting -> {{"Point", White, k {0, -10, 20}}},
Cuboid[k {0, -5, 0}, k {5, 0, 5}]}];
cube[1]


Looks good. Let's scale it a bit. cube[39]. Looks the same. Scale it a bit more cube[40]. The cube is totally black. As you rotate it, the light appears and then also starts rotating wildly, now the cube is black, a couple of turns and it's white. So, is it a bug or am I not reading the documentation carefully?

Edit: What does that +1 mean? Can you reproduce this behaviour? I got to test it on another system and see no problem with cube[10^30], so it must be my system, but what could be the culprit?

Edit: Setting Graphics Options/Rendering Options/Graphics3DRenderingEngine to "Software" makes the problem go away, so it must be something with hardware support. I have Windows XP SP3 with NVidia GeForce 9300.

-
I can reproduce it on Linux only, starting at cube[2819], but not on Mac or Windows. –  Szabolcs Oct 4 at 20:28
I can reproduce it on a Mac (V9.0.1) with cube[10^37] but not anything smaller that I tried. –  Michael E2 Oct 4 at 20:31
It's shaded correctly at 10^37 on my Mac, but the cube is deformed. At 10^38 it disappears. –  Szabolcs Oct 4 at 20:38
Artefacts when approaching 2^128 (about 3.4 * 10^38) are caused by effects of single-precision floating point arithmetic at its' limits. Single-precision floating point is commonly used on 3D graphics, both software and hardware. If you actually get artefacts at 40 (not 10^40!) it must be something entirely different. –  kirma Oct 5 at 7:06
This question appears to be off-topic because it is too localized and cannot be reproduced. –  Yves Klett Oct 5 at 11:43
show 1 more comment