When making games in unity I always hate how my scenes look. This is because I have no knowledge on how to make good use of the lighting capabilities in Unity. This sparked my interest in researching how to improve lighting in Unity. In this blogpost I’ll be going over some tips on how to improve lighting. I’ll show you step by step how to transform your scene from this:
![]() |
Before |
to this:
![]() |
After |
![]() |
Lighting window |
Skybox
Let’s start by editing the skybox, or at least the ambient light it’s providing. When creating a new Unity scene you get a standard skybox. This skybox also emits light. This can be nice for setting up a scene quickly but not for indoor scenes because the outdoor ambient light can’t go through walls.
You can change the ambient light in the lighting panel (Window > Lighting). In here you find all sorts of options about lighting in Unity. One of the options we are looking for is the Ambient Source. This is by default “Skybox”. For indoor scenes this is not optimal. So now you can do two things. Put it on Gradient or Color. For simplicity I put it on Color but you can also play with gradient. In the example I put the color on a brown, similar to the brown walls.
Emission material
The second tip you can take in consideration are Emissive materials. Emissive materials are materials that emit light. They are really good to make a computer screen light up (like I did in the example). You can also use them to make large areas light up like ceiling lights. BTW Emissive materials will only bounce on objects that are Static or Lightmap Static (I put it on Static because it gave me better results. Play with yours for the best results. See image below).
How to use the Emission map
When displaying a material in the inspector there is a Emission map. In the example scene I used 2 materials with the emission map active. The first one for the computer screens. Here I made multiple texture maps for the same object and assigned to one material. In the Albedo I placed the normal color map and in the Emission I placed the emission map. Note that everything black in the emission map does not emit light and everything white will. You can also use grey tones to make it emit less light.
The second Emission map I used was a lot easier. I made a material with a white albedo. I also made the emission white. By doing this it looks like there is light coming from the air vent (although I was hoping for a more promising effect).
![]() |
Computer material |
![]() |
Air vent material |
![]() |
Color map for computer |
![]() |
Emission map for computer |
Cookies
Cookies are like an overlay you put over your light. You can compare it to making shadow puppets. A cookie is just an image where white is transparent and black is solid. The solid parts wil block the light. I used a cookie to create the air vent shape in the light. While I could totally used the mesh from the air vent itself, I thought it would be cool to test the cookies.
![]() |
Cookie for air vent |
Sources
Random searches on Unity forums
Geen opmerkingen:
Een reactie posten