- Home /
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.
Answer by GameVortex · Dec 17, 2013 at 02:47 PM
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.
Your answer
Follow this Question
Related Questions
Can a camera cull lights on certain layers? 1 Answer
A simple light switch 3 Answers
"Tube Light" hanging in a Rope? 1 Answer
making a little lamp in Unity? 1 Answer
How to access the lights properties from within a shader? 1 Answer