[SOLVED] Is PointLight irregularity intentional?

I created PointLight that follows my mouse all over the screen. Everything works fine except for the fact that light doesn’t look ball-ish (as it should considering physics basics) but seem to be “dragged” to Poly edges. I have a voxel 2d world situation (flat screen of blocks) and light seem to have trouble traveling from one side of oblique (only) edges to the other.

The effect is the more visible the more light power I set (barely visible at values 0-1, insanely obvious at values 10+).

If you’re using 3.1, you can enable single pass lighting, which doesn’t have this issue:

renderManager.setPreferredLightMode(TechniqueDef.LightMode.SinglePass);

Thanks for info, but could You also explain in human language what’s causing this strange effect?

Btw. no, not using 3.1 yet :wink:

With multipass lighting (one render pass per lights ,that’s the only available choice in 3.0), lighting is computed for every vertex then interpolated for each pixel (that’s why you have the strange effect).
In 3.1, we implemented single pass lighting ( one pass for multiple lights) and incidentally fixed this issue because we had to compute lighting directly for each pixel.

If you want to keep 3.0, one way to alleviate the issue is to tesselate your model, so that the lighting interpolation is not as wrong.

1 Like

Great thanks for explanation :smile: