2
votes

Summary including updates:

  • Unity 5 scene using deferred lighting, containing approximately 200 lights spread along 800 units of space.

  • Most of the lights are point lights, some are spots - the spots work fine.

  • The point lights cut instantly to dark at around 150-200 units away from the camera.

  • If large numbers of point lights are moved inside this range they work without issue.

  • Switching the Render Priority between Auto and Important makes no difference.

  • If I play a different scene in the editor which allows me to load this scene, it displays correctly! It still does not display correctly when played directly or when running the build.


I've got a basic scene together, which consists of 5 cloned sections of corridor, each with 12 lights, so 60 total.

However, only the first couple of sections show properly, the others are almost completely dark:

Deferred light problem (please be kind, I only started this one today :P)

And from the editor, with the end section highlighted to show the distance better:

Deferred light problem - editor

As you can faintly see, the lights are actually there, just very, very dim:

Deferred light problem - zoomed

When you walk down the corridor, they snap to full brightness as you approach.

This is on a build with deferred lighting set, and the pixel light count turned right up, just in case.

I' guessed this might relate to LOD or camera range in some way, but I can't seem to get anything to effect the issue currently.

(This scene is actually based around the lights cutting out and switching to emergency lighting so I really do need to be able to control them!)


UPDATE

The lights you can see are spot lights. The lights that are disappearing are all point lights.

Point light disappear

You can just see the spot lights uplighting onto the ceiling in the distance, but the main ceiling lights just go completely dark.


UPDATE 2

I've added a frankly silly number of lights into the scene and extended the corridor, to run some tests.

There are now 24 lights per section, and a total of 8 sections, making 192 lights in all:

Lights - too many lights

I wanted to check if more lights would cut out, and they don't. It seems to be entirely based around range - around 150-200 units in my scene.

To confirm this, I also walked to the center of the tunnel to see if the number of lights visible would effectively double, including ones behind - they do.

I also moved all of the sections close to the camera to confirmed that all the lights can be displayed at once without problems, and this works as well.


UPDATE 3

I have found a situation where the scene displays correctly!

Lights working in strange situation

If I press play in the editor on my main menu scene, then press the UI button that loads this scene, it displays correctly!

It still does not display correctly either when playing the scene directly, or when running the final build.

1
Without putting too much thought into this, are you sure your scene isn't clipping? - Xander Luciano
Thought this myself, but definitely sure it's not clipping - you can still see the spot lights and emissive materials. The way the lights turn back on as you walk down - it's hard to explain without seeing it moving, but it's almost as if once the entire chunk gets within a certain range they all turn on at once. The model does use LOD but I'm pretty sure that has nothing to do with it. I've moved on for the time being, but I think at this point I'm just going to try rebuilding this scene and try and at least isolate the problem. - Octopoid
Maybe try baking a light map? - Xander Luciano
I need to be able to turn groups of them on and off independently - think the lights in each section shutting down towards you, then emergency lighting kicking up. (Not that I watch too much sci-fi horror of course :P) Because of the requirement to control the lights like this for the scene lightmapping probably won't help me here sadly. - Octopoid

1 Answers

1
votes

My solution for this problem is (I'm new, but I found this helped):

  1. Go to quality settings
  2. Search for Pixel Light Count
  3. Raise this number to actual number of your lights in your scene.
  4. This parameter establishes number of sources of light which can be displayed at they same time - I think.