Environment & Lighting Pt3

Chris Didier
5 min readMay 2, 2021

Today we will be working on part 3 of our environment and lighting section. This will be the last section covering these topics for our great fleece development.

We are first going to focus on setting up occlusion mapping. We are going to look at the door and the door_start and making the starting door look like our already finished product. An occlusion map is used to provide which areas of the 3D model to have high or low 3D lighting. This allows us to create false shadows. We are going to start off by creating a door material and attaching it to our door_start>front door>mesh_renderer. Next add our door texture via the albedo channel. Do the same for the occlusion map and search the door occlusion.

Next we are going to look at the emissions channel.

An emission channel is a light from a texture or color and not from a light source. This gives objects natural elumination look. For this we are going to look at the display case. Let’s click on the display case wood and look at the material

We are now going to remove the emission map by selecting the emission channel and selecting none.

To control the brightness select the color picker and select the intensity from it the higher the number the brighter it is. If you open up the image used for the surface you can see where the light was baked to where to illuminate the light. Add the emission back to it and we will be moving on to light mapping in the next section.

Next we are going to go over the light mapping. You might have noticed when we were making changes our scene was re-baking. There are two forms of baking in Unity one is the progressive preview which allows you to bake in real-time or the enlightened mode where you have to bake your scene before changes our scene.

To show a good example of this we are going to go to our light settings. To get there go to Window>rendering>lighting. We are currently in the progressive preview mode. If you look at the light probe visualization it is set to auto generate. If you turn that off you are responsible for your own lighting data baking. If you change to enlighten you will have to do the baking yourself. Now you will notice there is a checkbox called prioritize preview. This will prioritize baking what you’re looking at first that way you can make multiple changes very quickly.

As you can see using the progressive style the light map instantly updates.

Now we will be working with light probes over at the security guard desk. If an object were to walk past a light source we would want the object to pick up the light data. To create a new light probe group go to Create>light>light probe group.

Using one light probe to light up this entire room saves on resources tremendously as you do not want to have a large amount of lighting game objects that are constantly having to re-bake and load. Now we are going to work with the skybox that will give us the background to our scene. To start off we will be creating a new material called the new york skybox. We will also be changing the shader type to skybox>6-sided. Go down into your folders and you will see there is a skybox folder. From there add the cubemap into a slots for 0–5. The skybox will populate as you place it in there.

Once complete go to Window>Lighting>Settings>Environment and you will see there is a skybox material. We want to change out the current skybox material to the New York material created. This will change our whole environment and our new environment will bake itself in.

We can also add color to our scene by changing the environment lighting from the skybox to color as you can see above.

Finally to finish up our section on environment and lighting we will be looking at reflection probes and screen space reflections. To do this go to Create>light>reflection probe. Once added edit the collider and have it expand across the marble floor.

Screen space reflections use the post processing stack to really make a difference. If you go under the main camera you will want to enable to post processing behavior.

You would use a reflection probe for a mobile game, use reflection, but if you are going for console or pc games use screen space reflections.

--

--