[Bug] Spotlight breaks at big scale

Seems like if you place a spotlight part a certain place in space with a certain attenuation radius. It crashes the engine.

Steps to reproduce:

  • Open a project sample
  • Place a spotlight
  • Set the Attenuation radius to 16777216 (2^24) and set its position on an axis to 16777215 (2^24-1), It should not crash yet.
  • Now set the position on an axis to 16777216 (2^24), the editor will instantly crash.

It seems like the crash does not reproduce when using 8388608 (2^23) as Attenuation radius but breaks Somewhere between 16500000 and 16600000 (still for attenuation radius with 2^24 for the position).

I think that this is a bug as the directional lights have no issues and we should at those values only suffer from the precision lost at its best.

Cheers,
Erio

Hey Erio,

Spotlights are simply not built to function at that attenuation. Notice how the sliders Max is at 16384 when you attempt to slide it. This is intended so users do not exceed this amount when using spotlights.

If you want to use a spotlight with that extreme of a radius, I would look into a Directional Light Actor instead.

Thank you,

Hi Andrew,

Thanks for your answer.

I would suggest locking/clamping the value to then max then as having a slider max value does not refrain from typing in bigger values. :slight_smile:

Also, Yes, we can use Directionnal lights… But this will be a huge issue for us as those lights are currently used as Stars source emitters. So basically a directionnal light will do the job… On one side, but if there is another planet on the other side of the sun it will not get proper lighting as the light source would be between the two actors. (which makes it a hassle with directionnal lights)

Is there no way at all to have a point-emitted light (or even shape emitted) with very large scales such as this?

Using a directional light in conjunction with a skylight will help you illuminate your scenes ambient lighting. Even if there is no direct light hitting actors, you are able to still have lighting fill the darkest areas.

“but if there another planet on the other side of the sun it will not get proper lighting as the light source would be between the two actors”

I am pretty sure this is accurate, as this phenomenon is called an eclipse (unless I am misunderstanding). As I mentioned, each light type has its max radius which is the suggested extents in which you should use the light, as beyond this point there are other ways to approach illuminating your scene.

Thank you,

Alright. I will manage somehow. Do you know the reason the spotlight’ s radius is " so small" ?

Thanks.

This is done to keep the integrity of how a spot light functions as a light type.