Hello there,
we are struggling a bit on creating a good lighting system in our game so I would gladly accept any advice on the matter.
So our scenario
Simulation style game in URP, you place buildings and inside those buildings you place machines and your workers will move around to work. You can play and destroy any building and machine at runtime. The static environment is very very limited.
Our objective
During the day buildings and the environment have shadows from the sun. Buildings get sun through the windows but internal lighting is needed.
During the night interiors are lit and the light goes outside of the window but outside is going to be a bit dark blueish.
The day/night cycle was not a problem, we have a mixed directional light that rotates, there is no environmental lighting.
For the interiors it gets tricky for us, since everything is managed at runtime and machines are animated we had to keep them not static (right?). We tried with area light and probes but the machines and the workers seem very plain with no depth. We tried as well with spotlights with real-time light but we have the same problem (20m*20m room has 20 spotlights, seems too much no?). Also, I was expecting the spotlights to create shadows but got nothing.
I am thinking we are doing it entirely wrong, do you have any suggestions for us, please?
Thanks,
Paolo
Due to the dynamic nature of your environment, I don’t think that any precomputed lighting solutions will work for you (whether it’s lightmaps, or Enlighten realtime GI). You’d have to rely on fully dynamic lighting. Which means that area lights are out of the question. As a matter of fact, it does not make sense to use mixed directional lights either. Unless you are planning on baking part of your environment that will always remain static, such as terrain. In such case, mixed directional light could be useful, as you could sample indirect bounce from the terrain using light probes.
I would advise against using so many realtime lights, whether it’s spotlights or any other light type. This will negatively impact runtime performance, especially when using Forward renderer.
You will most likely have to rely on custom shaders and post processing effects to achieve the look you are after. When it comes to these questions, it is better to ask in the Universal Render Pipeline sub-forum.
1 Like
Thank you for your feedback and explanation, I appreciate it.
I understand your observations. We found a library that let you save a lightmap into a prefab but it doesn’t see the light probes so that solution is excluded. We then tried with some real-time lights but as you said the performance went down so quickly we had to drop it. So by the end, we decided to go for two directional real-time lights with very light shadows, one for the day and one for the night, keeping the world visible during the night as well. We will then add some lights to the machines the way you suggested.
Thanks again!
1 Like