Costume real time lighting updating script

Hi, I’m currently working on a game where I pretty much need realtime directional lighting but the perfomance dips so much that I came up with an idea. I haven’t seen any examples or some sort online, so I then decided to go for help on this forum.

The fps in my game sits around 150 and then when real time lighting gets turned on, it goes around 100. Now is there a way to let’s say update the directional light in realtime, but capped at 30 times a second? My game is kinda slow paced so it might not look laggy, but it’s something I really need to optimize my game.

Any help appreciated!

Well, I think the problems is in the hands of Unity. They have to provide us a performent solution. I mean other engines also suffer from the problem of updating the sun and sky lighting in realtime (plus updating the sky reflection probe). Enlighten was also not that fast. Now I see that in Unreal 4.26 they achieved a more performent way of updating the time of day lighting, it should be possible for Unity, too.

Even if you update only once you would probably notice a little bit of lag in your game. But you are fine with that you could just go the way and updating the sky only once in intervals of several seconds to minutes.

1 Like