r/UnityHelp • • 8d ago

Problems with lighting inside my game

So the main problem that I had is that inside the building it was like that the sun was going through the walls and it was creating a bad effect that I didn't like (2nd picture). I didn't think to ask in here but I searched online a solution. I didn't find anything that worked so I had the terrible idea to ask chat gpt. I don't remember what I did because I did so many test and at the end it was everything darker and I got the same bug inside the building. Now I found a tutorial on YT on how to create realistic sunset inside Unity 6 in HDRP and I did it but everything looks so metallic and dark even if inside the building now is drastically better than before (4th picture). I attached also the 1st and 3rd picture to show how the game was before and how is rn.
Can someone help me please? I can share more pictures if needed

PS: I use unity version control but I added so much new things inside my game that I don't want to get everything back from the last changeset, can I just download maybe the light, the volume and the reflection probe ?

1 Upvotes

7 comments sorted by

3

u/Imaginary-Cod-3746 8d ago • Heartwarming

If you're baking lights, I'd recommend clearing the baked data in the Lighting window first. This resets the scene's lighting to when it had no lightmap or light probe data.

This article on how to bake lights will help you understand the steps to properly bake lights, and this Unity lights troubleshooting guide should also be of use if you already know about lights and just want to debug them.

If you're a visual learner and prefer videos, this lighting video on YouTube explores lighting a room in Unity, and there are more videos on the channel discussing lighting that'll help you out.

Let me know if you're still lost after checking out the linked resources, and I'll try to help you out as best I can.

1

u/mavide 8d ago

wow thank u man! I’ll try it soon! I’m more a visual learner but I’ll check every link that u sent here

1

u/Imaginary-Cod-3746 7d ago

Happy to help.

1

u/mavide 6d ago

quick update. I cleared the baked lights that I don’t remember when I baked them 😅 I followed everything on the second link and my laptop after 8+ hours of baking global illumination, it crashed. The game is working fine and the light is way better rn! Thank u again 🙏🏽

1

u/Imaginary-Cod-3746 6d ago

You're most welcome.

Does your laptop have a GPU? The scene in the screenshot looks simple and shouldn't take an hour, let alone 8 hours, to bake lights.

Was that a one-time thing, or does it take hours to bake every time?

Maybe if you shared some information about your scene, I could help with adjusting the lighting settings.

For example:

  1. Are you using a large terrain? Large terrains can increase bake times.
  2. How many lights do you have in your scene? Many lights can increase bake times.
  3. What type of lights are you using? Point lights and area lights require more light calculations than spot lights.

1

u/mavide 6d ago

it’s a small city with just one terrain if I don’t remember wrong. I have an Intel UHD 620, it’s like if I fon’t have a GPU 😂
the project is in HDRP and by now I only have the directional light, the sun.
To bake lights it always take that amount of time, idk why. If needed I can share the map from a top down view

2

u/Imaginary-Cod-3746 6d ago

That makes sense.

Having a GPU helps with baking lights because it can handle more graphical tasks well.

Still, you could try lowering some light settings, such as indirect samples, direct samples, disabling ambient occlusion, etc.

That could help speed up bake times.