Cull point light at a distance

Hi,

I am doing the first round in optimizing my game. Since content is generated procedurally at runtime I need advice that respect that constraint. Now to the issue: In my scene a huge number of point lights are generated at runtime. Using layer cull distances on the default camera hides emitting objects as expected, but not the lights themselves. I know that for the time being, lighting calculations are the cause of the low fps.

Note: Deferred rendering is active.

What to I need to do in order to disable lights that are out of range?
I reckon looping over all lights each frame to check distance to the player is not an option.

I don’t know what quantity you have defined as a huge amount but looping over all lights to check the distance to the player can be a perfectly viable solution. The Vector3.Distance does not really have that big of performance impact and can be used a lot of times in one update.